Sending Emails from a Ubuntu Server – GMail

Standard

1)Instal SSMTP:

sudo apt-get install ssmtp

2)Edit /etc/ssmtp/ssmtp.conf

mailhub=smtp.gmail.com:587
hostname=USER@MYDOMAIN.com
root=USER@MYDOMAIN.com
AuthUser=USER@MYDOMAIN.com
AuthPass=PASSWORD
UseSTARTTLS=yes
UseTLS=yes
FromLineOverride=yes

3)Edit /etc/ssmtp/revaliases

This step is important!

root:USER@MYDOMAIN.com:smtp.gmail.com:587
matt:USER@MYDOMAIN.com:smtp.gmail.com:587

4)Send a Test E-mail

ssmtp test@test.com
To: Test Guy <test@test.com>
From: Me <USER@MYDOMAIN.com>
Subject: Hello World

Hello world!
Advertisements

2 thoughts on “Sending Emails from a Ubuntu Server – GMail

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s