iMarket Digital Properties

0 %
iMarket Digital Properties Ltd
Design · Develop · Monetize · Support
  • Location:
    United Kingdom
  • City:
    London
  • Service Area:
    Global
Business Systems
Business Services
24/7 Support
Websites
Web Applications
E-commerce Solutions
Digital Platforms
Products & Services
Public & Private Networks

How To Install And Configure Sendmail On Ubuntu

January 4, 2018

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:

Find your hostname by typing:

$ hostname

Then:

$ sudo nano /etc/hosts

On the line starting with 127.0.0.1, add the hostname to the end so it looks the same as:

127.0.0.1 localhost hostname

(You willl notice that your hostname can also be identified on the line that starts with 127.0.1.1 where it appears twice)

Ctrl+x, then ‘Y’ to save and exit.

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

$ sudo sendmailconfig

4. Restart Apache

$ sudo service apache2 restart

5. Using sendmail:

To quickly send an email:

$ sendmail -v [email protected]

After hitting the enter key, on the line directly below, enter a From address (each line after you hit enter will be blank):

From: [email protected]

Hit enter again and type a subject:

Subject: This is the subject field of the email

Hit enter again and type the message:

This is the message to be sent.

Hit enter again. To send the email, type a ‘.‘ (period/dot) on the empty line and press enter:

.

Wait a few seconds and you will see the output of the email being sent. To see more usage examples, check out the links below.

https://www.computerhope.com/unix/usendmai.htm
https://clients.javapipe.com/knowledgebase/132/How-to-Test-Sendmail-From-Command-Line-on-Linux.html
https://help.dreamhost.com/hc/en-us/articles/216687518-How-do-I-use-Sendmail-

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 (modify the php version below as necessary):

$ 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

Hosting

Develop and scale your apps globally with DigitalOcean and/or Vultr – or use shared hosting with no server maintenance required at iMarketHost.com.

Installation & Maintenance

If you would like to get this app installed, maintained or need training, Contact Me to get current rates.

Posted in BlogTags:
Write a comment