mail and mailx fail to send emails to gmail Quite frequently I have to send the outputs of my work on terminal (e.g. when compiling code) to my colleagues via email. I was wondering if it is possible to pipe (|) the output of a terminal command directly to email and I realized there are mail and mailx that can be used for this purpose. 

The problem is, when I try a simple message like this

ls -laF | mailx -s 'generated files' colleague@gmail.com


nothing is sent. How should I tackle this problem? In this post a very similar situation is asked and something is suggested but it's not the solution anymore.
OS X has postfix installed by default but it's not enabled (started). You can start it with

sudo postfix start


you can check the status and eventual problems in /var/log/mail.log

The configuration is in /etc/postfix/