1. Install the mail transmission agent
Sudo apt-Get install sendmail
Sudo apt-Get install sendmail-cf
2. Install mailutils
Otherwise, you cannot use the MAIL command.
3. Configuration
By default, Sendmail only sends emails to local users. Only by extending Sendmail to the Internet can it become a real mail server.
VI/etc/mail/sendmail. MC
Daemon_options ('family = Inet, name = MTA-v4, Port = SMTP, ADDR = 127.0.0.1 ') DNL
CD/etc/mail
# Mv sendmail. cf sendmail. cf ~ // Make a backup
# M4 sendmail. MC> sendmail. cf
If the following problem occurs:
* ** Error: feature () shocould be before mailer ()
* ** Mailer ('local') must appear after feature ('ways _ add_domain ') *** error: feature () shocould be before mailer ()
* ** Mailer ('local') must appear after feature ('allmasquerade ') *** error: feature () shocould be before mailer ()
Solution:
Modify the last few lines of sendmail. MC
VI/etc/mail/sendmail. MC
Add
Mailer_definitions
Mailer ('local') DNL
Mailer ('smtp ') DNL
Put it at the end of the document
3. restart Sendmail.
Service Sendmail restart
View:
Netstat-tlunp | grep 25
TCP 0 0 0.0.0.0: 25 0.0.0.0: * listen
4. send an email
Mail xx@qq.com-s "theme" <mail content .txt
But I don't know why I can't send 163.com emails?