How to install and configure sendmail in ubuntu to send emails (you can also send them in php, you can also send anonymous emails)

How to install and configure sendmail in ubuntu to send emails (you can also send them in php, you can also send anonymous emails)

1. Install sendmail

sudo apt install sendmail

2. Modify the /etc/hosts file and add the localhost.localdomain item (fully qualified domain name)

sudo vim /etc/hosts

Modified as follows:

127.0.0.1 localhost.localdomain localhost lenix-Swift-SF314-512

127.0.1.1 lenix-Swift-SF314-512

3. Modify the sendmail.mc configuration

cd /etc/mail

sudo vim sendmail.mc

Find the following 2 lines:

DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl

DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl

Adding dnl in front means commenting out these 2 lines to enable external network access.

Modified as follows:

dnl DAEMON_OPTIONS(`Family=inet,

The post How to install and configure sendmail in ubuntu to send emails (also in php and anonymously) first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/8712
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment