Doing mail from the Command Line is not as hard as you may think.

To send an email from your computer just open Terminal and type the following command:

 

 

 

Replace “Subject” with the subject of the mail messages that you are sending. You’ll then replace “recipient@example.com” with the email address of the recipient of the message. Finally, to write your message, include the <<EOF, followed by an enter, then type your message using as many newline characters as needed. When you are ready to stop writing and send your message, type “EOF” followed by the enter key.

A 1 Line method would look like this:

 

(notice the use of single quotes those are used if you want punctuation in title or subject.)

This will cause OS X to relay the message to your ISP’s SMTP server, and send the message to the recipient that you specified.

If you get an Error like:

 

Then you have to do a little more work like this:

 

You didn’t get any mail still then now you will have to setup Google as your SMTP server?

Configure Postfix for Gmail SMTP
Edit file /etc/postfix/main.cf

 

 

Generate sasl_password if not already exists

 

and enter in the following:

 

Run the following commands

 

I was trying to see if my port 25 was open so I used this command

 

A cool way to to see what ports are open with grep

 

Thats It enjoy what is built-in to your Mac!

edit: September 22, 2015

I forgot to tell you that you need to setup postfix to load automatically on boot so I added a file /System/Library/LaunchDaemons/org.postfix.master.plist file this file will load the postfix automatically.

so use nano to create a file with this command:

copy the text below and paste into that file.

Now I think it is working even on reboot.

To use this with XTension it is pretty easy also. In your attachments folder create a Handler with text like this:

The results are that you are using the simple send like above 1 line with the echo of the Body and this one will take punctuation in the Subject and Body.