Linux 通過 sendEmail 發送帶附件郵件

sendEmail是一個輕量級,命令行的SMTP郵件客戶端。如果你需要使用命令行發送郵件,那麼sendEmail是非常完美的選擇:使用簡單並且功能強大.這個被設計用在php、bash
perl和web站點使用。
以上是sendEmail的簡單介紹,千萬不要和sendmail搞混掉了。用了sendEmail你將不在喜歡sendmail了

1、下載安裝sendEmail


sendEmail下載地址:http://caspian.dotconf.net/menu/Software/SendEmail/
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz //下載1.56版本
tar -xzvf sendEmail-v1.56.tar.gz //解壓後就可以使用了
mv sendEmail-v1.56 /usr/local/bin/

2、發送郵件

/usr/local/bin/sendEmail -f  [email protected]  -t [email protected]     -s      smtp.163.com  -u "我是郵件主題" -o message-content-type=html   -o message-charset=utf8 -xu [email protected] -xp 123456  -m "我是郵件內容" -a /home/a.csv

命令說明

/usr/local/bin/sendEmail 命令主程序
-f  [email protected]  發件人郵箱
-t [email protected]      收件人郵箱
-s smtp.163.com       發件人郵箱的smtp服務器
-u "我是郵件主題"     郵件的標題
-o message-content-type=html   郵件內容的格式,html表示它是html格式
-o message-charset=utf8        郵件內容編碼</pre>
-xu [email protected]          發件人郵箱的用戶名
-xp 123456               發件人郵箱密碼
-m "我是郵件內容"        郵件的具體內容
-a /home/a.csv            發送a.csv這個文件
發送成功之後會有如下提示:
Jul 29 15:02:53 e10074 sendEmail[26347]: Email was sent successfully!

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