def mail(self):
"""
??????????????????
"""
getCodeUrl = 'https://api.weibo.com/oauth2/authorize?client_id={app_key}&redirect_uri={redirect_uri}'.format(
app_key=self.app_key, redirect_uri=self.redirect_uri)
line1 = "??????{error}".format(error=self.error)
line2 = "????code????????~"
line3 = "?????{url}".format(url=getCodeUrl)
msg = MIMEText(('<font color=#000000><br>{line1}<br>{line2}<br>{line3}</font>'
.format(line1=line1, line2=line2, line3=line3)), 'html', 'utf-8')
msg["Subject"] = "???????????"
msg["From"] = self.account
msg["To"] = self.recipient
try:
server = smtplib.SMTP_SSL("smtp.qq.com", 465)
server.login(self.account, self.password)
server.sendmail(self.account, self.recipient, msg.as_string())
server.quit()
except:
print("Because the mail sending error can not be reminded to the developer, to stop the program running")
sys.exit(0)
评论列表
文章目录