简体   繁体   中英

How to sending email with django using gmail

I am trying sending email for password reset but it giving me following error.

SMTPSenderRefused at /account/password_reset/ (530, b'5.7.0 Must issue a STARTTLS command first. x20sm7511321wme.6 - gsmtp', 'webmaster@localhost')......

here is my code.

EMAIL_USE_TSL = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'user@gmail.com'
EMAIL_PASSWORD = '*******'
EMAIL_PORT = 587

There's a typo. You wrote EMAIL_USE_ TSL instead of EMAIL_USE_ TLS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM