标签:cal content 成功 bubuko install server 技术 set message
yum -y install perl-Net-SSLeay perl-IO-Socket-SSL
tar xf sendEmail-v1.56.tar.gz -C /usr/local/
cd /usr/local/sendEmail-v1.56/
/bin/cp -ra sendEmail /usr/local/bin/
chmod +x /usr/local/bin/sendEmail
登录qq邮箱进行设置:
测试邮件发送:
cd /usr/local/sendEmail-v1.56/
sendEmail -f 1450595701@qq.com -t 1450595701@qq.com -u "zabbix_server" -s smtp.qq.com -o message-content-type=html -o tls=no message-charset=utf8 -xu 1450595701@qq.com -xp zoyswlqfhxhricdf
-m "邮件发送成功"
cd /usr/local/zabbix/share/zabbix/alertscripts
vim sendmail.sh
#!/bin/bash
# author:wei
to=$1
subject=$2
body=$3
from=1450595701@qq.com
smtp=smtp.qq.com
passwd=zoyswlqfhxhricdf #qq邮箱的兑换码
/usr/local/bin/sendEmail -f "$from" -t "$to" -s "$smtp" -u "$subject" -o message-content-type=html -o tls=no message-charset=utf8 -xu "$from" -xp "$passwd" -m "$body"
chmod +x sendmail.sh
chown zabbix.zabbix sendmail.sh
测试邮件发送:
sh sendmail.sh 1450595701@qq.com "hello world" "新.一天"
标签:cal content 成功 bubuko install server 技术 set message
原文地址:https://www.cnblogs.com/creater-wei/p/10014130.html