版权声明:转载请注明出处。 https://blog.csdn.net/paopaohll/article/details/84102206
一、安装:
-
安装sendmail:
yum -y install sendmail systemctl start sendmail
-
安装mailx:
yum install -y mailx
二、发送:
-
通过文件内容发送:
mail -s 'subject' [email protected] < example.txt
-
通过管道符直接发送:
echo 'content' | mail -s 'subject' [email protected]
三、设置发件人信息:vim /etc/mail.rc
set [email protected] set smtp=smtp.163.com set [email protected] set smtp-auth-password=密码 set smtp-auth=login
四、查看队列:
mailq
五、查看日志:
tail /var/log/maillog