Python Forum

Full Version: [flask] mail.send giving error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am getting an error from mail.send and I don't know why
def send_email(user, Type):
    if Type == 'reset':
        token = user.get_reset_token()
        msg = Message('Password Reset Request', sender='[email protected]', recipients=[])
        msg.body = f'''To reset your password for Gamer Blog click on the following link:
        {url_for('reset_token', token=token, _external=True)}
        If this was not requested simply ignore it. 

In another file -
app.config['MAIL_SERVER'] = ''
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
mail = Mail(app)
Without showing us the error,
it is difficult to help.
Sorry I forgot it but I can't get the error anymore because my website is getting other errors. I tried switching to Blueprints and now it is not working.