sendEmail:
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
tar zxf sendEmail-v1.56.tar.gz
mv sendEmail-v1.56/sendEmail /usr/local/bin/
Zabbix测试脚本:
#!/bin/sh
to=$1
subject=$2
msg=$3
user=xxxxx
passwd=xxxx
from=xxxxx@xxxx
smtp_server=xxxxx
/usr/local/bin/sendEmail -f $from -t $to -s ${smtp_server} -u $subject \
-xu $user -xp $passwd -m $msg \
-o username=$user \
-o message-content-type=html \
-o message-charset="utf-8"
#编码用utf-8,如果是utf8收到的依然是乱码。
本文出自 “方向感” 博客,请务必保留此出处http://itech.blog.51cto.com/192113/1862559
原文地址:http://itech.blog.51cto.com/192113/1862559