Terminal 101: Sending Email through the Command Line

5

Comments

+ Add a Comment
avatar

EdwardD20

This doesn't seem to work anymore with Mavericks. Anybody else?

avatar

Amanda French

Great tip, Cory. I'm going to use this to show my students the difference between the Internet and the Web -- I think a lot of people have only ever used webmail.

avatar

shawnjordison

I receive an error:

$ send-mail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory

Does this happen because I do not use Apple's Mail.app?

avatar

damiano.mic

What happens if you reply to the local email address? Where does it go (or does it just bounce back)

avatar

corybohon

If you're replying from a public email account (say Gmail), then the message will not be received and will be returned as undelivered; however, you can also send an email to any user on the same machine, and they will receive the email from inside of the Terminal. If you login, you might see a "You have mail" flag on the login notice. You can actually check these mail messages from the terminal by typing the following command: 

mail

This will list the emails that were received by your user account through the terminal email program. 

Log in to Mac|Life directly or log in using Facebook

Forgot your username or password?
Click here for help.

Login with Facebook
Log in using Facebook to share comments and articles easily with your Facebook feed.