標籤:ubuntu smtp 發郵件
centos上:
第一步:在qq郵箱設定-->賬戶中開啟pop3/smtp服務,並設定獨立密碼
第二步:yum install -y mailx
第三步:vim /etc/mail.rc 在檔案最後添加你的郵箱資訊:
set [email protected]
set smtp=smtp.qq.com
set smtp-auth-user=82312924
set smtp-auth-password=Your password
set smtp-auth-login
第四步:就能直接使用echo "本文" |mail -s "主題" [email protected]
ubuntu上:
ubunut上mailx這個命令對應的deb包有bsd-mailx和heirloom-mailx
bsd-mailx對應的設定檔是/etc/mail.rc跟centos一樣,but配置了認證資訊之後還是不能發郵件,具體原因我也沒找到。。。
heirloom-mailx對應的設定檔是/etc/nail.rc。
配置過程如下:
第一步:在qq郵箱設定-->賬戶中開啟pop3/smtp服務,並設定獨立密碼
第二步:apt-get install heirloom-mailx
第三步:vim /etc/nail.rc 在檔案最後添加你的郵箱資訊:
set [email protected]
set smtp=smtp.qq.com
set smtp-auth-user=82312924
set smtp-auth-password=Your password
set smtp-auth-login
第四步:就能直接使用echo "本文" |mail -s "主題" [email protected]
本文出自 “接著丶來” 部落格,請務必保留此出處http://comingon.blog.51cto.com/4870913/1608506
ubuntu和centos下使用外部smtp發郵件