def send_email(user): token = user.get_reset_token() msg = Message('Your Account Recovery', recipients=[user.email]) msg.body = f'''To reset your password, please visit the following link: {url_for('users.reset_password', token=token, _external=True)} If you are not trying to change your password, please ignore this email. It is possible that another user entered their information incorrectly. ''' mail.send(msg)
def send_reset_email(user): token = user.get_reset_token() msg = Message('Password Reset Request', sender='*****@*****.**', recipients=[user.email]) msg.body = f'''To reset your password, visit the following link: {url_for('users.reset_token', token=token, _external=True)} If you did not make the request , please ignore this email. ''' mail.send(msg)
def send_email_to_myself(form): msg = Message( subject=f"Contact From {form.name.data} - My Blog", sender=current_app.config['MAIL_USERNAME'], recipients=[current_app.config['MAIL_USERNAME']], body=f"From {form.name.data}({form.email.data})\n\n{form.message.data}" ) mail.send(msg)
def send_reset_email(user): #pip install flask-mail token = user.get_reset_token() msg = Message('Password Reset Request', sender='*****@*****.**', recipients=[user.email]) msg.body = f'''To reset your passwork, visit the following link: {url_for('reset_token', token=token, _external=True)} If you did not make this request then simply ignore this email and no chang made ''' mail.send(msg)