flask-mail icon indicating copy to clipboard operation
flask-mail copied to clipboard

sender = sender or current_app.extensions['mail'].default_sender

Open NASA1nk opened this issue 3 years ago • 1 comments

I use flask_mail in blueprint,app = Flask(__name__) in app.py so I first from app import app in blueprint then set sender app.config["MAIL_DEFAULT_SENDER"] finally mail = Mail(app) when run msg = Message(subject="xx", recipients=[xx], body=info) and mail.send(msg) raise an error:sender = sender or current_app.extensions['mail'].default_sender

NASA1nk avatar May 01 '22 15:05 NASA1nk

I think it's the reason why app is referenced in the blueprint when I set app.config["MAIL_DEFAULT_SENDER"] and mail = Mail(app) in app.py And I do not import app but import mail in blueprint it works

NASA1nk avatar May 01 '22 15:05 NASA1nk

I can't reproduce this issue with the information provided. If it's still happening, open a new issue with a minimal reproducible example, including the full traceback.

davidism avatar May 23 '24 14:05 davidism