Cannot set Django to work with smtp.gmail.com

前端 未结 5 1616
不知归路
不知归路 2021-01-01 13:05

I\'ve been trying to get django to work with gmail\'s smtp server to send mails but I always get this traceback. Any help will be most appreciated.

----- settings.p

5条回答
  •  生来不讨喜
    2021-01-01 13:20

    I had the same problem, and I searched for half a day to find a solution. Most of the proposed solutions are talking about where you should initialize EMAIL_USE_TLS in relation to the other settings. I don't think this is a solution for the problem.

    I found the solution at: https://support.google.com/accounts/answer/185833?hl=en and finally https://security.google.com/settings/security/apppasswords

    If you are testing your project on a local machine, you should go to the latter link, and enable "Access for less secure apps".

提交回复
热议问题