1,使用mail发送邮件
编辑/etc/mail.rc 追加
set from=xxx@163.com smtp=smtp.163.com
set smtp-auth-user=xxx@163.com smtp-auth-password=xxxsmtp-auth=login
然后
echo 'test' | mail -s "hello" xxx@qq.com
另外可能出现的问题:
smtp-server: 554 DT:SPM 163 smtp12,EMCowED5cERLc3dWIdgjAA--.22871S2 1450668875,please see http://mail.163.com/help/help_spam_16.htm?ip=219.133.160.83&hostid=smtp12&time=1450668875
"/root/dead.letter" 0/0
. . . message not sent.
邮件服务器判定发送的是垃圾邮件