linux mailx使用外部smtp發送郵件

環境:

exchange 2010:

ip:192.168.101.18

域:gz.newp.local

用戶賬戶:[email protected]

smtp地址:mail.gz.newp.local


linux:

rhel 6.3

軟件:mailx


linux配置:

# vim /etc/mail.rc

添加如下行:

set [email protected]

set smtp=mail.gz.newp.local

set smtp-auth=login

set [email protected]

set smtp-auth-password=’123456a!’



windows:

爲認證用戶添加sendas權限,否則linux端會報錯哦

錯誤信息550 5.7 1 client does not have permissions to send as this sender”




測試:

# mail -v -s “Test” [email protected] < /etc/hosts

-v:顯示發送過程

-s:subject,即主題

[email protected]:收件人

< /etc/hosts:郵件正文由/etc/hosts文件導入


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章