這期內容當中小編將會給大家帶來有關ubuntu配置外部smpt將email 發送外網的操作過程,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
添加heirloom-mailx apt源
cat /etc/apt/sources.list.d/mailx.list
deb /tupian/20230521/ xenial main universe
更新apt
apt update
安裝heirloom-mailx
apt install heirloom-mailx -y
配置外部發件郵箱
編輯 /etc/s-nail.rc在最后加上:
set from="[email protected]" #發件地址
set smtp="smtps://smtp.163.com:465" #smtp服務器
set smtp-auth-user="[email protected]" #登錄發件地址
set smtp-auth-password="xxxx" #明文密碼
set smtp-auth=login #登錄方式,默認是login,也可以改成CRAM-MD5或PLAIN方式
set from="[email protected]"
set smtp="outlook.office365.com:587"
set smtp-auth-user="[email protected]"
set smtp-auth-password="xxxx" #明文密碼
set smtp-use-starttls #加密方式
set ssl-verify=ignore # 忽略ssl認證
set smtp-auth=login
set from="[email protected]"
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user="[email protected]"
set smtp-auth-password="ahkphxxabcbshabbga" #QQ郵箱授權碼
set smtp-auth=login
常用命令
常用命令:
n:不讀入設置文件(本系統中是/etc/s-nail.rc)(這個文件允許用戶使用外部郵件傳輸代理而不是使用系統自帶的sendmail發送郵件)。
s:設置郵件的主題信息。
c:使用一個抄送列表。
b:使用一個密送列表。
發送測試郵件
echo "內容"|s-nail -s "主題" [email protected],[email protected] #多個郵箱用逗號隔開
或者:
s-nail -s "郵件主題" [email protected] < result.txt
加參數v可以看到mail輸出的詳細信息
s-nail -vs "郵件主題" [email protected] < result.txt
發送帶附件
s-nail -a 附件 -s "主題" 收件地址 < 文件(郵件正文.txt)
s-nail -a /xxx.tar.gz -s "主題" [email protected] < ./xxx.txt
shell 當編輯器,編輯完內容后按Ctrl-D結束
s-nail -s '主題‘ [email protected]
上述就是小編為大家分享的ubuntu配置外部smpt將email 發送外網的操作過程了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注創新互聯-成都網站建設公司行業資訊頻道。
網站欄目:ubuntu配置外部smpt將email發送外網的操作過程-創新互聯
文章轉載:http://www.2m8n56k.cn/article30/cepcso.html
成都網站建設公司_創新互聯,為您提供全網營銷推廣、服務器托管、手機網站建設、虛擬主機、外貿建站、品牌網站設計
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:[email protected]。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯