Skip to main content

Posts

Showing posts from May, 2014

How to send mail from Ubuntu Server

We have our own in-house dedicated web server at our company running Ubuntu Server 13.04. Recently we upgraded most of our websites to the content management systems and added the functionality of user interaction and eCommerce. We wanted to have email notification whenever a contact form or new eCommerce order is submitted. I tried a number of ways to enable send mail functionality on the Ubuntu web server but I am going to share here the simplest and easy way of doing this;

From Ubuntu Server Terminal windows;

Install ssmtp:
sudo apt-get install ssmtp

Edit the ssmtp config file :
nano /etc/ssmtp/ssmtp.conf
Enter the following contents in the file;
root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password
FromLineOverride=YES
UseTLS=YES

Replace the username and password with your Gmail or Google Apps details.

Save the file and exit nano editor. You are done !

Now to test that everything is working fine. In the terminal window, enter the reci…