Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Zabbix uses sendEmail to send email

Shulou Source: shulou.com Published: 2022-06-01 04:10:14 10月06日 Update

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

Tags: Message parameter address content type three name recipient title user script subject garbled sender media media password server user name mailbox Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Microsoft Linux macOS