Send emails from your Ubuntu VPS using SSMTP
published on
At some point you will likely want to send email from your VPS. You may want to send set up Logwatch or Fail2ban, you may want to allow your script to email you when it has completed or you may simply want to send notifications from some application you've installed on your VPS.
Whatever the reason you can do all of this simply with SSMTP.
Install SSMTP
This is as simple as running sudo apt install ssmtp mailutils at the command line. Setting it up isn't much more difficult either.
Setting up SSMTP
To get SSMTP up and working type sudo nano /etc/ssmtp/ssmtp.conf at the command line and add, edit or update the contents to look like the ones below:
root=<your-email-address>mailhub=<mail-server-address>:<mail-server-port>FromLineOverride=YESAuthUser=<your-account's-user-name>AuthPass=<your-account's-password>UseTLS=YESUseSTARTTLS=YES
Once finished your VPS should be able to send mail.
