詳細介紹見官網:http://caspian.dotconf.net/menu/Software/SendEmail/html
sendEmail是個十分優秀的發郵件的小工具,比起sendmail強了百倍,我在本地測試zabbix報警的時候,剛開始使用的是sendmail來發送郵件,在測試過程當中發現,有時候死活收不到郵件,有時候收到郵件了,可是延遲特別大,要麼在垃圾箱裏面,非常苦惱.服務器
因此我最後使用了sendEmail工具,感受特別好用。只要配置正確,郵件就可以及時到達。不說了。直接進入正題工具
安裝:測試
1 wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz //下載1.56版本 2 tar -xzvf sendEmail-v1.56.tar.gz //解壓後就能夠使用了 3 mv sendEmail /usr/local/bin/
一個實例:ui
1 /usr/local/bin/sendEmail -f [發送者地址] -t "接收者" -s [你的smtp服務器地址] -u "發送的主題" -xu [smtp驗證登錄名(郵箱名字)] -xp [你在後臺獲取的登陸密碼(通常不是郵箱密碼)] -m "郵件內容" 2 實例 3 /usr/local/bin/sendEmail -f 5712xx@qq.com -t 18387xxx@139.com -s smtp.qq.com -u "我是主題" -o message-charset=utf-8 -xu 5712xx@qq.com -xp airjyrcdzjtbbdbf -m "我是郵 件內容"
簡單說下「 -xp [你在後臺獲取的登陸密碼(通常不是郵箱密碼) 」哪裏獲取 以qq郵箱爲例spa
第一步:進入qq郵箱,點擊設置,而後帳戶.net
第二步:點擊開啓code
第三步:orm
最後:按照提示覆制受權碼htm
具體詳細使用能夠看幫助:
1 [root@iZ940ao463eZ alertscripts]# /usr/local/bin/sendEmail help 2 Oct 20 22:40:56 iz940ao463ez sendEmail[29186]: Error: "help" is not a recognized option! 3 4 sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net> 5 6 Synopsis: sendEmail -f ADDRESS [options] 7 8 Required: 9 -f ADDRESS from (sender) email address 10 * At least one recipient required via -t, -cc, or -bcc 11 * Message body required via -m, STDIN, or -o message-file=FILE 12 13 Common: 14 -t ADDRESS [ADDR ...] to email address(es) 15 -u SUBJECT message subject 16 -m MESSAGE message body 17 -s SERVER[:PORT] smtp mail relay, default is localhost:25 18 19 Optional: 20 -a FILE [FILE ...] file attachment(s) 21 -cc ADDRESS [ADDR ...] cc email address(es) 22 -bcc ADDRESS [ADDR ...] bcc email address(es) 23 -xu USERNAME username for SMTP authentication 24 -xp PASSWORD password for SMTP authentication 25 26 Paranormal: 27 -b BINDADDR[:PORT] local host bind address 28 -l LOGFILE log to the specified file 29 -v verbosity, use multiple times for greater effect 30 -q be quiet (i.e. no STDOUT output) 31 -o NAME=VALUE advanced options, for details try: --help misc 32 -o message-content-type=<auto|text|html> 33 -o message-file=FILE -o message-format=raw 34 -o message-header=HEADER -o message-charset=CHARSET 35 -o reply-to=ADDRESS -o timeout=SECONDS 36 -o username=USERNAME -o password=PASSWORD 37 -o tls=<auto|yes|no> -o fqdn=FQDN 38 39 40 Help: 41 --help the helpful overview you're reading now 42 --help addressing explain addressing and related options 43 --help message explain message body input and related options 44 --help networking explain -s, -b, etc 45 --help output explain logging and other output options 46 --help misc explain -o options, TLS, SMTP auth, and more
你喜歡的話試試吧,極力推薦,不要再使用sendmail了