Example #1
0
def reset_password():
    username = input("(Reset Password)Enter your username: "******"Your new password is :" + password_generator()
    email_subject = "Reset password"
    SendEmail.send_email(email_to, email_text, email_subject)
    def sendmessage(self):
        print "start send ..."
        self.check_items()
        print "check finished"

        data = self.update_config() if self.update_config() else self.config_data
        data['date'] = self.report_date.get()
        data['today_data'] = self.today_task.get(1.0, END)
        data['unfinished_data'] = self.unfinished_task.get(1.0, END)
        data['tomorrow_data'] = self.tomorrow_task.get(1.0, END)
        data['think_data'] = self.think_task.get(1.0, END)

        daily_docx = built_docx(data)
        if daily_docx:
            data["file_path"] = daily_docx
            se = SendEmail(data)
            se_status = se.send_email()
            if se_status:
                tkMessageBox.showinfo(u"邮件发送成功",daily_docx)
                # self.clear()
            else:
                tkMessageBox.showinfo(u"发送失败,请重试")
                # self.clear()
        else:
            tkMessageBox.showinfo(u"保存失败,请检查。")