環境:CentOS 7
準備産品:
阿裡雲伺服器 (
https://www.aliyun.com/product/ecs)
阿裡雲企業郵箱賬戶(
https://wanwang.aliyun.com/mail/ 過程:1.編輯 /etc/mail.rc 檔案内容,追加以下内容(請替換其中的登入使用者和密碼值):
set smtp="smtps://smtp.mxhichina.com:465"
set smtp-auth=login
set smtp-auth-user="[email protected]"
set smtp-auth-password="Ni-De-Mi-Ma"
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb

2.發信測試(請替換其中的回信、收信位址和标題):
echo message3 | mail -v -r "[email protected]" -s "This is the subject" [email protected]
3.執行指令後,顯示發信成功。收件人郵箱中,有信
看到上圖,說明已經成功了