apt-get install ssmtp
- In
/etc/ssmtp/ssmtp.conf
:mailhub=smtp.gmail.com:587 UseTLS=Yes UseSTARTTLS=Yes AuthUser=gmail login AuthPass=gmail password hostname=your hostname FromLineOverride=YES
- In
/etc/ssmtp/revaliases
:localusername:realemailaddress:smtp.gmail.com:587
Test with "
echo hello | mail my@email.address
".(The gotcha is apparently the port number: some sources give a different port and that just makes ssmtp block(?).)