Doing mail from Terminal is not as hard as you may think.

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

“`

mail -s "Subject" recipient@example.com <

“`

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 &lt;&lt;EOF, do not forget the 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.

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:
“`

sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory

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

“`

sudo mkdir -p /Library/Server/Mail/Data/spool
sudo /usr/sbin/postfix set-permissions
sudo /usr/sbin/postfix start

“`

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

“`

sudo nano /etc/postfix/main.cf

“`

“`

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes

“`

Generate sasl_password if not already exists

“`

sudo nano /etc/postfix/sasl_passwd

“`

and enter in the following:

“`

[smtp.gmail.com]:587 username@gmail.com:password

“`

Run the following commands

“`

sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
sudo launchctl stop org.postfix.master
sudo launchctl start org.postfix.master

“`

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

(echo >/dev/tcp/localhost/25) &>/dev/null && echo "TCP port 25 opened" || echo "TCP port 25 closed"

“`

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

sudo lsof -i -P | grep -i "listen"

“`

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