关闭sendmail或者postfixvim
service sendmail stop
chkconfig sendmail off
service postfix stop
chkconfig postfix off
安装mailx
yum install mailx服务器
备注:
使用外部邮箱帐号时,不须要启动sendmail或者postfix
若是在sendmail或者postfix启动的同时使用外部邮箱发送报警邮件,首先会读取外部邮箱ide
设置mailx发信帐号
yum -y install mailx
ln -s /bin/mailx /bin/mail
vim /etc/mail.rc
#服务端转发邮件到指定邮箱
set from=yourmail@163.compost
#填写发送邮箱服务器地址smtp
set smtp=smtp.163.comit
#我的邮箱用户
set smtp-auth-user=yourmail@163.com
#我的邮箱密码
set smtp-auth-password=****
set smtp-auth=loginclass