1.首先stop sendmail和postfix
system status sendmail
system stop sendmail
system status postfix.service
system stop postfix.service
2.安装mail
yum install mailx -y
3.编辑配置文件
vim /etc/mail.rc
在最后添加下面内容
set from=xxxxx@126.com #发送服务器
set smtp=smtps://smtp.126.com:465 #smtp服务器地址,如果不使用ssl方式,可写成:set smtp=smtp.126.com:25
set smtp-auth-user=xxxxxx@126.com #发送者邮件