Wednesday, March 9, 2016

Flask, how to send email. Configuration

   Using gmail as flask's sendmail server

1, First configure flask as below:     

        MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USERNAME = 'email@gmail.com'
MAIL_PASSWORD = 'password'
MAIL_USE_TLS = True
MAIL_USE_SSL = False

2, Change your google account settings: 

Google blocks sign-in attempts from apps which do not use modern security standards(mentioned on their support page). You can however, turn on/off this safety feature by going into the link below:

Go to this link and select turn on :