def send_mail(self, subject, content, mail_address): if not self.use_email: return if self.debug: mail_address = '*****@*****.**' print('email AI: sending email to {}...'\ .format(mail_address)) emailAI = Email(receiver=mail_address, sender='*****@*****.**', subject=subject, content=content) emailAI.conn_server(host='smtp.qq.com', port=587) emailAI.login(username='******', password='******') emailAI.send() emailAI.close()