1.安装sendmail

yum install -y sendmail*


2.编辑配置

vi /etc/mail.rc
set from=mailuser@163.com smtp=smtp.163.com
set smtp-auth-user=mailuser smtp-auth-password=xxxxx
set smtp-auth=login


3.重启服务

/etc/init.d/sendmail reload


4.测试

echo "nagios test" |mail receive-user@163.com