sendEmail是一個輕量級,命令行的SMTP郵件客戶端。若是你須要使用命令行發送郵件,那麼sendEmail是很是完美的選擇:使用簡單而且功能強大.這個被設計用在php、bash、perl和web站點使用。php
下載及安裝html
# wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gzweb
# tar -xvf sendEmail-v1.56.tar.gzbash
sendEmail-v1.56/服務器
sendEmail-v1.56/CHANGELOGide
sendEmail-v1.56/README編碼
sendEmail-v1.56/README-BR.txturl
sendEmail-v1.56/TODOspa
sendEmail-v1.56/sendEmail.net
sendEmail-v1.56/sendEmail.pl
拷貝命令到系統環境變量路徑下
# cd sendEmail-v1.56/
# cp sendEmail /usr/local/sbin/
/usr/local/sbin/sendEmail 命令主程序
發郵件命令以下:
# sendEmail -f name@163.com -t 123456@qq.com -s smtp.163.com -u "2017-05-03 record" -xu name -xp passwd -m "2017-05-03 record" -a "/data/test.txt"
-f xxxxx@163.com 發件人郵箱
-t 123456@qq.com 收件人郵箱
-s smtp.163.com 發件人郵箱的smtp服務器
-u "郵件主題" 郵件的標題
-o message-content-type=html 郵件內容的格式,html表示它是html格式
-o message-charset=utf8 郵件內容編碼爲utf8
-xu name@163.com 發件人郵箱的用戶名
-xp passwd 發件人郵箱受權密碼
-m "郵件內容" 郵件的具體內容
-a /data/test.txt 發送test.txt 這個文件
163郵箱須要在網頁後臺開啓受權碼
發送成功後會提示:
May 02 17:42:13 host sendEmail[58811]: Email was sent successfully!