Hi,
i have created a new azure web app and deployed the below mentioned flask code to the app using azure cli command from my local computer. Right now, while running the app its throwing error that "ModuleNotFoundError: No module named 'flask_mail'"
I already installed requirement.txt and flask-mail is also mentioned over there. any idea why its showing now ?
from flask import Flask, render_template
from flask_mail import Mail, Message
app = Flask(__name__)
app.config.update(
DEBUG=True,
MAIL_SERVER='COMPANY SMTP SERVER NAME',
MAIL_PORT=25,
MAIL_USERNAME='XXXXXX@ge.com'
)
mail = Mail(app)
@app.route('/')
def mailSend():
try:
msg = Message("Send Mail Tutorial!",
sender="XXXXXX@ge.com",
recipients=["YYYYY@ge.com"])
msg.html = render_template('thankyou.html')
mail.send(msg)
return 'Mail sent!'
except Exception as e:
print(type(e))
print(e)
return 'error'
@ryanchill if you have any suggestion please let me know.
FYI, I already deployed this code before as well to another web app and that time though it didn't send any mail but it didnt throw any error like this.