yum -y install mailx
cd /etc
mv mail.rc mail.rc.bak
vim mail.rc? ?#將如下內(nèi)容考貝過去
set from="92***47@qq.com"
set smtp=smtp.qq.com
set smtp-auth-user=92***47@qq.com
set smtp-auth-password=tgevqpxfxbunbcbg? #注意是QQ郵箱SMTP授權(quán)碼,如果修改了qq秘密,授權(quán)碼要重新生成
set smtp-auth=login
至此可以發(fā)送郵件了。
發(fā)送測試:echo 郵件內(nèi)容 | mail -s "郵件測試" ***@******.cn