1. 程式人生 > >Centos7 下配置mail使用163郵箱傳送郵件

Centos7 下配置mail使用163郵箱傳送郵件

編輯/etc/mail.rc配置檔案

# shift + g 直接到最後一行編輯
sudo vim /etc/mail.rc

# 在檔案末尾加入以下配置
set [email protected]163.com
set smtp=smtp.163.com
set [email protected]163.com
set smtp-auth-password=客戶端授權密碼 #163郵箱需要單獨配置一個“客戶端授權密碼”給客戶端使用
set ssl-verify=ignore
set nss-config-dir=/etc/maildbs/
set smtp-auth=login

163客戶端授權密碼設定方式

直接上圖

測試郵件是否能正常傳送

# 通過管道符指定要傳送的內容
echo "this is content." | mail -s "this is subject." -a ~/file.txt [email protected]