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

FromLineOverride=YES
AuthUser=youremail@gmail.com
AuthPass=yourpassword
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

After that, test email can send it or not with the following command
echo “tesitng” | mail -s “testing” william.aceplus@gmail.com

============================
Checking Error about mail
/var/log/mail.err
============================

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

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

 

Cheers

Advertisements

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:

127.0.0.1 localhost.localdomain localhost
127.0.1.1 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 <fromaddress@somemail.com>
To: MR_TEST<toaddress@somemail.com>
first line of my message for testing

Testing

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

Reference Site : http://developernote.com/2012/07/how-i-configured-sendmail-for-php-on-ubuntu-server-12-04/