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 AuthPass=your password here FromLineOverride=YES UseSTARTTLS=Yes UseTLS=Yes
echo “THIS is a test” | ssmtp -s “TEST” ” 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 *