Sending Email using terminal on macOS Sonoma 14.5

I tried searching for this, but couldn't find anything. I am trying to send a mail from terminal using the below command

echo "Hello World" | mail -s "Test email" someone@me.com


Secondly, I also want to attach a random image from one of my folders with this email. This is just a project.

MacBook Pro 13″, macOS 14.5

Posted on Jun 12, 2024 4:59 AM

Reply
9 replies

Jun 12, 2024 6:48 AM in response to Vivek_D

The only difference I can see is that I sent the email to a hotmail account. Also, when I use the syntax as you provided, there is no other response from terminal. It just executes. Then I check my hotmail account and see the email from a user by the name of my iMac computer name, with a subject of Test email, and the email contents of Hello World. I just now tried the same exact thing to my gmail account. I received no errors in Terminal but the email never showed up in my gmail inbox. Weird. (PS - I double checked the Junk folder too and it's not there either)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Sending Email using terminal on macOS Sonoma 14.5

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.