Skip to content
Snippets Groups Projects
Commit 703adc78 authored by ktongxue2018's avatar ktongxue2018
Browse files

new file: mail_proxy/mail_proxy.py

parent a44efa6e
No related branches found
No related tags found
No related merge requests found
from flask import Flask,request
from yagmail import SMTP
from base64 import b64decode
def send_mail(to_addr,content):
s = SMTP('{email}','{password}')
s.send(to =to_addr,subject='hexang.com',contents=content)
app = Flask(__name__)
@app.route('/send_mail/',methods = ['POST'])
def send():
to_addr = request.form['to']
url = request.form['content']
content = """
Hi ,
This is hexang.
Please reset your account password through the following link:
{}
---
Best regards,
Team hexang
""".format(url)
send_mail(to_addr,content)
if __name__ == '__main__':
app.run(host='0.0.0.0',port=8000)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment