Required Packages Luckily, installing this on Debian/Ubuntu is dead simple. bash
apt-get install ssmtp
Then, you'll need to edit your ssmtp.conf file.
nano /etc/ssmtp/ssmtp.conf
and paste something like this in.
[email protected]
mailhub=smtp.gmail.com:587
rewriteDomain=
[email protected]
UseSTARTTLS=YES
AuthUser=username
AuthPass=password
FromLineOverride=YES
Press crtl+x, and then y to save and exit.
Then add each account that you want to be able to send mail from by editing, bash
nano /etc/ssmtp/revaliases
and paste...
root:[email protected]:smtp.gmail.com:587
youruser:[email protected]:smtp.gmail.com:587
Just replace youruser with your Ubuntu username and [email protected] with your gmail address.
Resources:
http://zackreed.me/articles/39-send-system-email-with-gmail-and-ssmtp