Linux uses mail to send external SMTP messages the first chapter explains
Resources:
Http://coolnull.com/2614.html
Linux comes with mail that allows external SMTP to be sent. There is no need to configure postfixlocally,sendmail mail server, configure the whole set down really takes some time.
Environment:
Ip |
Host Name |
Operating system |
Note |
192.168.120.130 |
db130 |
CentOS Release 6.10 (Final) |
|
Chapter II Implementation of the 2.1 shutdown of the SendMail service or Postfix
service SendMail stopchkconfig sendmail offservice postfix stopchkconfig postfix off# need to install this tool Yum Install Mail
2.2 Modifying/etc/mail.rc
server address: POP3 server: Pop. 163 . COMSMTP server: SMTP. 163 . COMIMAP server: IMAP. 163. com
add a bit like N rows, specify the external SMTP server address, account password, and so on.
CP/etc/mail.rc/etc/mail.rc.bak. 'Date+%y%m%d%H ' [[email protected]~]#Cat/etc/Mail.rc# added the following ################# add new Context:set from=13439017540@163. Comset SMTP=smtp.163. Comset SMTP-auth-user=13439017540@163. Comset SMTP-auth-password=xxxxxset SMTP-auth=Login# exit after saving, test send messageEcho "Hello"| Mail-s"Title" 13439017540@163. com depending on the speed of the network, carrier, SMTP, mail delivery will have a delay phenomenon. # no attachments sent [[email protected]Yum. repos.d]#EchoHello Word | Mailx-v-S"title" 13439017540@163. comresolving host SMTP.163. com ... Done. Connecting to220.181.12.17... connected . ->>>EHLO db130 --Mail --pipelining --AUTH LOGIN PLAIN --auth=LOGIN PLAIN --Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa --XXXXXXXB -8BITMIME>>>AUTH LOGIN334Dxnlcm5hbwu6>>> mtm0mzkwmtc1ndbamtyzlmnvbq==334Ugfzc3dvcmq6>>>TFDXMTM0NTQW235Authentication Successful>>> MAIL from:<13439017540@163.com> -Mail OK>>> RCPT to:<13439017540@163.com> -Mail OK>>>DATA354End Data with <CR><LF>.<CR><LF>>>> . -Mail OK queued as SMTP13,ECCOWAD3RB23TI9BPLOFDA--. 36134s21536117944>>>QUIT221Bye[[email protected]Yum. repos.d]# #带有附件的发送方式mailx-v-s"Title3" 13439017540@163. com </root/install.mysql.SH
Linux uses mail to send external SMTP messages