update
This commit is contained in:
parent
43e65023c1
commit
dc0dda9c47
7
app.py
7
app.py
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue