How to install Mail Service at Ubutu Live Serer (LEMP)

How to install Mail Service at Ubutu Live Serer (LEMP)

Install mailutils by the following command
apt-get install mailutils
apt-get install ssmtp

edit ssmtp.conf under /etc/ssmtp/ssmtp.conf
Remove “#” from “#FromLineOverride=YES” and add the following lines to ssmtp.conf


After that, test email can send it or not with the following command
echo “tesitng” | mail -s “testing”

Checking Error about mail

if some setting are not and you want to re-configure the setting

Reconfigure / Resetting setting
sudo dpkg-reconfigure postfix
sudo dpkg-reconfigure mailutils



How I configured sendmail for PHP on Ubuntu Server 14.04

Go to terminal and run the following command to install sendmail
aptitude install sendmail

I put “mysite.localhost” (mysite is my server name) to /etc/hosts so it looks like this: localhost.localdomain localhost mysite.localhost mysite

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Create one sample text file for test email (body.txt)

Subject: test mail to Some Address!
From: Me <>
first line of my message for testing


To test how sendmail works I used the following command:
/usr/sbin/sendmail -t -f -v -i < body.txt

Reference Site :