标签:
def send1(self,warning):
m1=self.mailEdit.text()
m2=self.mailEdit_2.text()
m3=self.mailBox.currentText()
text=self.mailEdit_3.text()
import smtplib#man1邮箱服务器man2邮箱地址,paww是密码,text文本
from email.mime.text import MIMEText
msg=MIMEText(warning)
msg[‘Subject‘] = u‘pyqt的问题‘
msg[‘Form‘]=‘869710179@qq.com‘
try:
smtp=smtplib.SMTP()
smtp.connect(unicode(m1))
smtp.login(‘%s‘%(m2),text)
smtp.sendmail(‘%s‘%(m2),[‘%s‘%(m2)], msg.as_string())
smtp.close()
except Exception as e:
print e
标签:
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4300002.html