Flask-Mail not sending emails, no error is being reported

前端 未结 3 2034
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 15:06

All, I\'m trying to setup flask-mail to send notifications to my email when a user registers. I\'m getting no error messages from the script used to send the email, but not

3条回答
  •  遥遥无期
    2021-01-17 15:25

    I know this post is from a while ago, but I just ran into the same issue. Like @tbicr mentioned make sure that app.testing is set to False. As it states in the Flask-Maildocs here:

    "If the setting TESTING is set to True, emails will be suppressed. Calling send() on your messages will not result in any messages being actually sent."

    This was exactly my problem. I implemented Google reCAPTCHA into one of my forms and the app.testing was set to True so I did not have to hit the reCAPTCHA box every time. By removing the app.testing or by setting it to False, the emails were able to be sent.

提交回复
热议问题