yum install mailx
[root@centos ~]$vim /etc/mail.rc
set from=你的qq号@qq.com #发件人
set smtp=smtp.qq.com #端口
set smtp-auth-user=你的号 #登录邮箱帐号
set smtp-auth-password=666666 #授权码(已改)
set smtp-auth=login
set ssl-verify=ignore #忽略ssl加密
echo “this is content” | mail -s ‘this is title’ 你的号@qq.com