首先参考的是:
https://blog.csdn.net/a1010256340/article/details/81119912

我是用的qq邮箱给126邮箱发送的,是没有任何问题的。
其中要注意的是:

set sendcharsets=iso-8859-1,utf-8
set [email protected]
set smtp=smtp.qq.com:25
set [email protected]
set smtp-auth-password=bxjhdalukidcjh

echo "zabbix test mail" | mail -s "zabbix" [email protected]
echo "zabbix test mail" | mail -s "zabbix" [email protected]

最后都测试通过

最后发现 文章内容总是以附件形式出现,解决方法是:
https://blog.csdn.net/qhsy2016/article/details/80534861

修改邮件发送脚本内容:
#!/bin/bash
#export.UTF-8 ###解决发送的中文变成了乱码的问题
FILE=/tmp/mailtmp.txt
echo "$3" >$FILE
dos2unix -k $FILE ###解决了发送的邮件内容变成附件的问题。
/bin/mail -s "$2" $1 < $FILE
创建临时文件并授权


一些做的过程的日志:
set sendcharsets=iso-8859-1,utf-8
set [email protected]
set smtp=smtp.qq.com:25
set [email protected]
set smtp-auth-password=bxjukjtidcjh

echo "zabbix test mail" | mail -s "zabbix" [email protected]
echo "zabbix test mail" | mail -s "zabbix" [email protected]

Trigger: {TRIGGER.NAME}
Trigger status: {TRIGGER.STATUS}
Trigger severity: {TRIGGER.SEVERITY}
Trigger URL: {TRIGGER.URL}

Item values:

  1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}
  2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}
  3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}

Original event ID: {EVENT.ID}

Trigger: {TRIGGER.NAME}
Trigger status: {TRIGGER.STATUS}
Trigger severity: {TRIGGER.SEVERITY}
Trigger URL: {TRIGGER.URL}

Item values:

  1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}
  2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}
  3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}

Original event ID: {EVENT.ID}

#!/bin/bash
#export.UTF-8
FILE=/tmp/mailtmp.txt
echo "$3" >$FILE
dos2unix -k $FILE
/bin/mail -s "$2" $1 < $FILE

touch /tmp/mailtmp.txt
chown zabbix.zabbix /tmp/mailtmp.txt