Unix mail command not sending email

emailosx

I'm having trouble trying to send email with the unix mail command.
Currently I'm trying this:

echo "something" | mail -s "test mail" email@address.com

But when I check my email, I haven't received it.

How do I get it working? I'm using Mac OS X 10.7

Best Answer

So, it's probably at least one thing, possibly two.

  1. You need to enable the mail service. On the latest MacOSX, postfix is installed by default. You just need to run 'sudo launchctl start org.postfix.master' to start the postfix server. That'll just temporarily start it for your current session. Check to see if any mail can be sent. Look in /var/log/mail.log.
  2. If mail can't be sent out via port 25 (for example, comcast blocks outgoing port 25), you'll need to configure postfix to deliver mail through either Comcast's SMTP service or via some other SMTP server.

I found some well-documented instructions here on how to set up GMail's SMTP server and enable MacOSX's postfix service.

Related Question