标签:nta subject connect plain crontab cront sub port fms
import os
import smtplib
from email.mime.text import MIMEText
from email.header import Header
sender = ‘ ‘
receiver = ‘i ‘
smtpObj = smtplib.SMTP()
smtpObj.connect(‘smtp.fmsh.com.cn‘,25)
print(‘connect\n‘)
smtpObj.login(‘ ‘,‘ ‘)
message = MIMEText(‘crontab test‘,‘plain‘,‘utf-8‘)
message[‘From‘]=Header(‘test email‘,‘utf-8‘)
message[‘Subject‘]=Header(‘test subject‘,‘utf-8‘)
smtpObj.sendmail(sender,receiver,message.as_string())
标签:nta subject connect plain crontab cront sub port fms
原文地址:https://www.cnblogs.com/idyllcheung/p/13935932.html