Send email from local system: sSMTP

Setting up an entire email server is not required to avail some basic email features. To send email from localhost system, sSMTP i.e. Simple SMTP is enough and installation is also very easy compared to setting up a Mail Transfer Agent.

1. Install
$ sudo apt-get install ssmtp

2. Edit configuration
$ sudo vim /etc/ssmtp/ssmtp.conf

The config file should be updated like this

# Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named

# Where will the mail seem to come from?

# The full hostname

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address

3. Test the setup
$ ssmtp

Create the mail

Subject: test subject

Test body.

Enter Ctrl + D

That’s all to get the email in inbox


Leave a Reply

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

You are commenting using your 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