I am using Ubuntu 16.04 LTS. I was trying to send email from the command line to my Gmail address. So instead of monitoring tools sending info and warning emails to root I want them to arrive in my proper email address.
I tried Postfix but after a month of trying to make it work and looking at mail logs, I give up. I removed it and installed ssmtp instead. The configuration is very simple. Open the file:
and make sure these appears on the file:
Close and save the file. Then test it with:
$echo “Test email for SSMTP” | mail -s “Test Email” gmailaddress.com
Check if you receive the email. If not then you could check the mail logs with: