使用mailx向163郵箱傳送郵件
阿新 • • 發佈:2021-07-07
第一步:安裝mailx軟體
[root@backup ~]# yum install -y mailx
第二步,編輯配置檔案,
## 若不知道mailx服務配置檔案,使用rpm -qc檢視
1 [root@backup ~]# rpm -qc mailx 2 /etc/mail.rc 3 [root@backup ~]# vim /etc/mail.rc
第三步,在配置檔案最後面追加內容
[root@backup@scripts]# vim /etc/mail.rc
set [email protected] ##郵箱地址
set smtp=smtps://smtp.163.com ##郵箱smtp地址
set [email protected] ##郵箱地址
set smtp-auth-password=xxxxxxxxxxxxxxxxxxxxx ##smtp生成的校驗碼
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
測試功能:
echo "hello,world"|mailx -v -s "test" [email protected]