Skip to content

Yet another way to configuring Linux to send emails using mailutils and ssmtp.

Notifications You must be signed in to change notification settings

vanderblugen/Send-Emails-from-Linux-with-SSMTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Send-Emails-from-Linux-with-SSMTP

This is for configuring Linux to be able to send emails.

This information was obtained from here for my enjoyment and so I don't have to look for this again. This has been tested on a Raspbery pi and an Ubuntu machine.

This configuration uses Gmail as the email carrier. It will work with others, just used gmail in this configuration. Less secure apps or 2 factor with app passwords needs to be enabled for this configuration to work.

Install needed apps

sudo apt-get install ssmtp mailutils -y

Edit ssmtp.conf configuration file

sudo mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.bak
sudo nano /etc/ssmtp/ssmtp.conf

Paste and update this information into the file and Ctrl+X to exit

root=GmailEmailAddress@gmail.com
mailhub=smtp.gmail.com:587
hostname=raspberrypi
AuthUser=GmailEmailAddress@gmail.com
AuthPass=TheGmailPassword
FromLineOverride=YES
UseSTARTTLS=YES

Edit revaliases configuration file

sudo nano /etc/ssmtp/revaliases

Update this information in the file

root:GmailEmailAddress@gmail.com
postmaster:GmailEmailAddress@gmail.com

Send test email

echo "Test Email" | mail -s "Test Email" DestinationTestEmail@Address.com

About

Yet another way to configuring Linux to send emails using mailutils and ssmtp.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published