singleTimer.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:reptile 作者: shawncan 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号