#!/usr/bin/env python # coding=utf-8 import smtplib from email.mime.text import MIMEText def mailf(errdate,biaoti): user = "[email protected]" pwd = "3。。。。4一排" to = "[email protected]" msg = MIMEText(errdate) msg["Subject"] = biaoti msg["From"] = _user msg["To"] = _to s = smtplib.SMTP("smtp.tom.com", timeout=300) s.login(_user, _pwd) s.sendmail(_user, _to, msg.as_string()) s.close() if __name__==‘__main__‘: mailf(‘neirong‘,‘header‘)
时间: 2024-11-03 21:03:14