centos7使用sendmail发送邮件
Lee_吉关注0人评论36608人阅读2017-12-29 06:08:10
一、安装:
- 安装sendmail:
yum -y install sendmail
systemctl start sendmail
- 安装mailx:
yum install -y mailx
二、发送:
- 通过文件内容发送:
mail -s '主题' complet@163.com < test.txt
- 通过管道符直接发送:
echo '内容' | mail -s '主题' complet@163.com
三、设置发件人信息:vim /etc/mail.rc
set from=complet@163.com
set smtp=smtp.163.com
set smtp-auth-user=用户名
set smtp-auth-password=密码
set smtp-auth=login
四、查看队列:
mailq
五、查看日志:
tail /var/log/maillog
转载于:https://my.oschina.net/u/3367404/blog/3037356