文章出處

轉載:http://www.blogjava.net/jasmine214--love/archive/2010/10/09/334102.html
Linux下mail利用外部郵箱發送郵件的方法:
1、下載安裝mailx
sudo apt-get  install heirloom-mailx
2、修改/etc/nail.rc (/etc/mail.rc)
set from=username@domain.com smtp=smtp.domain.com
set smtp-auth-user=username smtp-auth-password=password
set smtp-auth=login
eg:
set from=tiny@163.com smtp=smtp.163.com
set smtp-auth-user=tiny smtp-auth-password=123456
set smtp-auth=login
說明:
from是發送的郵件地址
smtp是發生的外部smtp服務器的地址
smtp-auth-user是外部smtp服務器認證的用戶名
smtp-auth-password是外部smtp服務器認證的用戶密碼
smtp-auth是郵件認證的方式
配置成功后,就可以使用了
可以發送一封郵件測試一下:
mail -s "test" user@sohu.com <content.txt 其中-s后面的是郵件標題,user@sohu.com是收件人地址,content.txt里面是郵件正文



文章列表




Avast logo

Avast 防毒軟體已檢查此封電子郵件的病毒。
www.avast.com


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()