This commit is contained in:
王思川 2021-05-13 10:38:51 +08:00
parent 43e65023c1
commit dc0dda9c47
1 changed files with 6 additions and 1 deletions

7
app.py
View File

@ -1,4 +1,4 @@
from flask import Flask, request
from flask import Flask, request, render_template
from flask_mail import Mail, Message
from threading import Thread
@ -28,12 +28,17 @@ def send_mail():
msg = Message(title, sender=sender, recipients=recipients)
msg.body = msg_body
# msg.html = render_template('email.html', user=msg_body['user'], verify_code=msg_body['verify_code'])
thread = Thread(target=send_async_email, args=[app, msg])
thread.start()
return "邮件已发送"
@app.route('/', methods=['GET'])
def index():
return {"info": "server_mail"}
if __name__ == '__main__':
app.run()