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:
#nano /etc/ssmtp/ssmtp.conf
and make sure these appears on the file:
mailhub=smtp.gmailaddress.com:587
Authuser=gmailaddress
Authpass=AppPassword
UseTLS=YES
UseSTARTTLS=YES
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:
#tail /var/log/mail.log
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:
#nano /etc/ssmtp/ssmtp.conf
and make sure these appears on the file:
mailhub=smtp.gmailaddress.com:587
Authuser=gmailaddress
Authpass=AppPassword
UseTLS=YES
UseSTARTTLS=YES
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:
#tail /var/log/mail.log
Comments