ubuntu和centos下使用外部smtp發郵件

來源:互聯網
上載者:User

標籤: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發郵件

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.