python - flask-mail gmail: connection refused -
i'm getting following error when attempt use flask-mail send email through gmail account.
error: [errno 10061] no connection made because target machine actively refused it
i've tried configuring flask-mail in various ways, far error.
here sample configurations i've tried:
-
app = flask(__name__) mail = mail(app) app.config.update(dict( debug = true, mail_server = 'smtp.gmail.com', mail_port = 465, mail_use_tls = false, mail_use_ssl = true, mail_username = 'my_username@gmail.com', mail_password = 'my_password', ))
-
app = flask(__name__) mail = mail(app) app.config.update(dict( debug = true, mail_server = 'smtp.gmail.com', mail_port = 587, mail_use_tls = true, mail_use_ssl = false, mail_username = 'my_username@gmail.com', mail_password = 'my_password', ))
this configuration flask mega-tutorial (http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xi-email-support)
app = flask(__name__) mail = mail(app) app.config.update(dict( debug = true, # email server mail_server = 'smtp.googlemail.com', mail_port = 465, mail_use_tls = false, mail_use_ssl = true, mail_username = 'my_username', mail_password = 'my_password', # administrator list admins = ['my_username@gmail.com'] ))
has else experienced similar problem?
as far can tell there nothing wrong configuration. problem application not using it. should update configuration before initialize mail
:
app = flask(__name__) app.config.update(dict( debug = true, mail_server = 'smtp.gmail.com', mail_port = 587, mail_use_tls = true, mail_use_ssl = false, mail_username = 'my_username@gmail.com', mail_password = 'my_password', )) mail = mail(app)
Comments
Post a Comment