Send email from Centos to your gmail account —USING SSMTP

NB: i’m working with a centos 6 server called
a valid gmail account in my case

a valid gmail password for the which is mygmailpassword

You might have the need to send an email from your Centos/RedHat server to your gmail account.

Here’s a very quick “how-to”

On your centos server, download ssmtp

#yum install -y ssmtp

Next, we will edit /etc/ssmtp/ssmtp.conf and add the following lines (or edit to add lines)”

Next, you will edit the following file, /etc/ssmtp/revaliases

where you will add the following


mygmailaccount has to be a valid gmail account
mygmailpassword has to be the password of the above account.

You can verify by sending a test email

echo “test 123” | ssmtp -vvv

Leave a Reply

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