How to Send Email from Ubuntu to Anywhere

How to Send Email from Ubuntu to Anywhere

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

AuthUser=someone@gmail.com
AuthPass=s0m3p@$$w0rd
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

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 *