Example #1
0
def sendmail(username, serstr):

    # with current_app.app_context():
    with creat_app().app_context():
        print("准备发送")
        msg = Message(subject="神秘组织激活邮件", recipients=[username])
        # msg.html = "<a href='http://127.0.0.1:5000/active/" + str(r2[0]) + "'>点击激活</a>"
        msg.html = "<a href='http://127.0.0.1:5000/active/%s'>点击激活</a>" % (
            serstr, )
        mail.send(msg)
Example #2
0
from factory import creat_app

app = creat_app()

if __name__ == "__main__":
    from waitress import serve
    serve(app, host="0.0.0.0", port=5000)

# app.run(host = '0.0.0.0', port = 5000)