Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask
- from flask_mail import Mail, Message
- import time
- app = Flask(__name__)
- app.config.from_pyfile('config.cfg')
- mail = Mail(app)
- @app.route('/mail/')
- def index():
- msg = Message('Hello', sender = 'info@MyDomain.com', recipients = ['info@MyDomain.com'], reply_to = 'visitor@HisDomain.com')
- msg.body = 'Hi ' + time.ctime()
- mail.send(msg)
- return "Sent Ok"
- if __name__ == "__main__":
- app.run()
- <visitor@HisDomain.com> wrote
Add Comment
Please, Sign In to add comment