Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[flask] mail.send giving error
#1
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=[user.email])
        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. 
        '''
        mail.send(msg)

In another file -
app.config['MAIL_SERVER'] = 'smtp.googlemail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
mail = Mail(app)
Reply
#2
Without showing us the error,
it is difficult to help.
Reply
#3
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. https://python-forum.io/Thread-Flask-No-...tion-found
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Server Error with parse_args() using Flask NoNameoN 0 1,063 Jul-30-2022, 09:42 AM
Last Post: NoNameoN
  send mail is freezing rwahdan 0 1,366 Jan-02-2022, 09:06 AM
Last Post: rwahdan
  [split] flask 500 internal server error DarthTensor 3 3,946 Nov-11-2021, 06:10 AM
Last Post: DarthTensor
  Error updating one to many relationship in Flask/ SQLAlchemy atindra 0 3,300 Apr-15-2021, 10:29 PM
Last Post: atindra
  Send Keys Error? AgileAVS 0 1,560 Oct-06-2020, 07:53 AM
Last Post: AgileAVS
  TemplateNotFound error with flask Veztar 4 18,554 Aug-28-2020, 07:02 AM
Last Post: Veztar
  Sending How to send private message with Flask-Socketio and Vue jonte 0 4,409 Jul-28-2020, 08:14 PM
Last Post: jonte
  Running flask run produces error. Charles1 1 4,028 Oct-04-2019, 10:38 PM
Last Post: snippsat
  [Flask] html error 405 SheeppOSU 0 2,315 Jun-08-2019, 04:42 PM
Last Post: SheeppOSU
  About Error (Flask) bescf 1 2,617 Mar-20-2019, 08:18 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020