停止sendmail和postfix
service sendmail stop
chkconfig sendmail off
service postfix stop
chkconfig postfix off
使用mail / mailx發(fā)送郵件
rpm -qa|grep mailx 查看是否安裝mailx
vim /etc/mail.rc 更改配置文件
add new context: 網(wǎng)易
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客戶端服務(wù) 在web頁面賬號設(shè)置中
set from=1293472700@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=1293472700@qq.com
set smtp-auth-password=SMTP授權(quán)碼,不是郵箱密碼
set smtp-auth=login
echo "內(nèi)容" |mail -s "主題" 1293472700@qq.com(郵箱) 測試語句