-1
I’m trying to create a code that sends email outlook with flask, but for some reason it won’t, I tested with gmail, tbm is not going
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = '[email protected]
app.config['Mail_PASSWORD'] = '******'
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = False
app.config['MAIL_ASCII_ATTACHMENT'] = False
mail = Mail(app)
@app.route('/')
def index():
msg = Message('hello', sender='[email protected]', recipients=['[email protected]'])
return 'Message Sent'
if __name__ == "__main__":
app.run(debug=True)