一、安装sendmailvim
# yum install -y sendmail测试
# yum install -y sendmail-cfspa
二、配置发送邮件的邮箱认证信息orm
# vim /etc/mail.rc ci
在后面添加一下内容:it
set from=xxxxx@xxx.com #发送者的邮箱登录
set smtp=smtp.exmail.qq.com #邮箱的SMTP配置
set smtp-auth-user=xxxxx@xxx.com #发送者的邮箱密码
set smtp-auth-password=***** #邮箱密码im
set smtp-auth=login #自动登陆
三、测试发送邮件
echo '邮件内容' | mail -s "邮件标题" -r xxxxx@xxx.com hhh@163.com aaa@163.com
说明:xxxxx@xxx.com为发送者邮箱,要和第二步设置邮箱一致,hhh@163.com aaa@163.com是收件人,多个收件人用空格隔开。