I'm using Flask-Mail to connect to my TLS-enabled Gmail account. Gmail server is sending email in development but when I use the same configs in production on PythonAnywhere Google blocks it.
app configs:
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = False
app.config['MAIL_DEBUG'] = True
app.config['MAIL_USERNAME'] = 'not_really_real@gmail.com'
app.config['MAIL_PASSWORD'] = 'hakunamatata'
app.config['MAIL_DEFAULT_SENDER'] = None
app.config['MAIL_SUPPRESS_SEND'] = False
app.config['DEBUG'] = False
error output from log:
2020-05-15 11:00:30,374: reply: b'534-5.7.14 <https://accounts.google.com/signin
/continue?sarp=1&scc=1&plt=AKgnsbv\r\n'
2020-05-15 11:00:30,374: reply: b'534-5.7.14 oxngN3wR6W-Y9cpG25Ukl-pska7XdVPprbwY7Kbo-YIKDgX3uBKMC5EtBrLsPEZ_KQr9o\r\n'
2020-05-15 11:00:30,374: reply: b'534-5.7.14 yH2as6SxNhxW2uYRmWriQFM4eSGDsuhmqvU40HYZvKb9DYPdUkuLtnW87gMqA4bt>\r\n'
2020-05-15 11:00:30,374: reply: b'534-5.7.14 Please log in via your web browser and then try again.\r\n'
What can I do ? I already reviewed Google settings and allowed everything it considered suspicious.