How to Send Emails from Linux using sSMTP

How to Send Email from Linux using sSMTP

First you need to install ssmtp on you Ubuntu machine which can be done by this command
sudo apt-get install ssmtp
Go and configure the ssmtp configuration file
sudo gedit /etc/ssmtp/ssmtp.conf
AuthMethod=LOGIN AuthUser=yourmail@domain.com AuthPass=your password here FromLineOverride=YES mailhub=smtp.gmail.com:587 UseSTARTTLS=Yes UseTLS=Yes RewriteDomain=gmail.com
echo “THIS is a test” | ssmtp -s “TEST” ABC@gmail.com ” You can check the status of the mail with the help of the exit codes. If it returns a Zero the program ran fine ” echo $?

Leave a Reply

Your email address will not be published. Required fields are marked *