|
【求助:selenium+python】使用QQ发邮件问题:为什么没有收到邮件呢,界面上也没有报错信息,怎么破?
PSQ邮箱已经开启了IMAP/SMTP服务
源码如下:
import smtplib
from email.mime.text import MIMEText
from email.header import Header
smtpserver='smtp.qq.com'
user='*********@qq.com'
password='*********'
sender='*********@qq.com'
receive='*********@qq.com'
subject='Python email tree'
msg=MIMEText('<html><h1>hello<h1><html>','html','utf-8')
msg['Subject']=Header(subject,'utf-8')
smtp=smtplib.SMTP()
smtp.connect(smtpserver,465)
smtp.login(user,password)
smtp.sendmail(sender,receive,msg.as_string())
smtp.quit()
|
|