停止sendmail和postfix
service sendmail stop
chkconfig sendmail off
service postfix stop
chkconfig postfix off
使用mail / mailx发送邮件
rpm -qa|grep mailx 查看是否安装mailx
vim /etc/mail.rc 更改配置文件
add new context: 网易
set from=邮箱账户
set smtp=smtphm.qiye.163.com 邮箱账户的smtp配置
set smtp-auth-user=邮箱账户
set smtp-auth-password=邮箱密码
set smtp-auth=login
add new context: 腾讯 要开通smtp客户端服务 在web页面账号设置中
set from=1293472700@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=1293472700@qq.com
set smtp-auth-password=SMTP授权码,不是邮箱密码
set smtp-auth=login
echo "内容" |mail -s "主题" 1293472700@qq.com(邮箱) 测试语句