On FreeBSD
1: Check log:
tail -f /var/log/cron
tail -f /var/log/maillog
2: Replace sendmail with ssmtp
vi /etc/rc.conf file.. and add:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
3: Launch following commands:
killall sendmail
cd /usr/ports/mail/ssmtp/
make install replace clean
4: Edit ssmtp conf file:
vi /usr/local/etc/ssmtp/ssmtp.conf
.... and add following lines:
root=yourrealemail@example.com
mailhub=smtp.example.com:465
RewriteDomain=example.org
UseTLS=YES
AuthUser=user@example.com
AuthPass=password222
FromLineOverride=YES
Hostname=yourhostname
5: Enter following command:
echo ‘ssmtp_enable=“YES”’ >> /etc/rc.conf
p.s.
other explained options of ssmtp.conf are here:
http://www.techrepublic.com/blog/it-security/use-ssmtp-to-send-e-mail-simply-and-securely/