#!/usr/bin/python -- coding: utf-8 -- "”” Zabbix SMTP Alert script for gmail. "”” import sys import smtplib from email.MIMEText import MIMEText from email.Header import Header from email.Utils import formatdate Mail Account MAIL_ACCOUNT = ‘[email protected]’ MAIL_PASSWORD = ‘your mail password’ Sender Name SENDER_NAME = u’Zabbix Alert’ Mail Server SMTP_SERVER = ‘smtp.gmail.com’ SMTP_PORT = 587 TLS SMTP_TLS = True def send_mail(recipient, subject, body, encoding='utf-8’): session = None msg = MIMEText(body, ‘plain’, encoding) msg[‘Subject’] = Header(subject, encoding) msg[‘From’] = Header(SENDER_NAME, encoding) msg[‘To’] = recipient msg[‘Date’] = formatdate() try: session = smtplib.

Continue reading

Author's picture

LuLU

Love coding and new technologies

Cloud Solution Consultant

Canada