How To Install And Configure Sendmail On Ubuntu

https://gist.github.com/adamstac/7462202

https://www.abeautifulsite.net/configuring-sendmail-on-ubuntu-1404

1. Install Sendmail

$ sudo apt-get install sendmail

2. Configure /etc/hosts file:

$ sudo nano /etc/hosts

Change the ‘127.0.0.1 line to add your hostname to look like the same as:

127.0.0.1 localhost.localdomain yourhost

example:

127.0.0.1       localhost Home.lan Home
127.0.1.1       Home.lan     Home

3. Run Sendmail’s config and answer ‘Y’ to everything:

$ sudo sendmailconfig

4. Restart apache

$ sudo service apache2 restart

ERRORS & SOLUTIONS

If you can not send mail.

When sending emails from your server, make sure to check any spam folders for receipt. If email is for some reason not working, try the steps below:

4 sudo nano /etc/php/7.0/fpm/php.ini

Ctrl+w to search for and find ‘sendmail_path’. Uncomment this line and add the path below:

sendmail_path= /usr/sbin/sendmail -t -i

Restart php:

$ sudo service php7.0-fpm restart

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.