Using Flask-Mail to send Email through Gmail- socket.gaierr Using Flask-Mail to send Email through Gmail- socket.gaierr flask flask

Using Flask-Mail to send Email through Gmail- socket.gaierr


I have the following settings that work for me

app.config['MAIL_SERVER']='smtp.gmail.com'app.config['MAIL_PORT'] = 465app.config['MAIL_USERNAME'] = 'xx@gmail.com'app.config['MAIL_PASSWORD'] = 'xx;'app.config['MAIL_USE_TLS'] = Falseapp.config['MAIL_USE_SSL'] = True

Note that MAIL_USE_TLS parameter that I have. Also not sure if it matters but your MAIL_SERVER is set to smtp.google.com while mine is smtp.gmail.com.

EDIT: As confirmed, the primary issue was that your smtp host was incorrectly set. It should always be smtp.gmail.com