Zabbix uses sendEmail to send email
Vim / home/zabbix/bin/mail.sh
#! / bin/bash
SMTP_server='smtp.163.com' # SMTP server
Username='m14718177839' # user name
Password='20190214fang' # password
From_email_address='463245818@qq.com' # Sender Email address
To_email_address= "$1" # recipient Email address, the first parameter passed in by zabbix
Message_subject_utf8= "$2" # message header, the second parameter passed in by zabbix
Message_body_utf8= "$3" # message content, the third parameter passed in by zabbix
# convert the email title to GB2312 to solve the problem that the email title contains Chinese and the received email shows garbled codes.
Message_subject_gb2312= `iconv-t GB2312-fUTF-8