gpt4 book ai didi

'Settings' object has no attribute 'EMAIL_HOST_USESR'(“设置”对象没有属性“”Email_HOST_USESR“”)

转载 作者:bug小助手 更新时间:2023-10-25 18:48:21 28 4
gpt4 key购买 nike



I wanna send email by django and gmail smtp and I see this error.

我想通过Django和Gmail SMTP发送电子邮件,但我看到了这个错误。


the code below is my email setting

下面的代码是我的电子邮件设置


EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'MY EMAIL'
EMAIL_HOST_PASSWORD = 'MY PASSWORD'
EMAIL_PORT = 587


i expect to send email without any problems

我希望能毫无问题地发送电子邮件


更多回答
优秀答案推荐

Case1: To send emails through Gmail SMTP in Django, you need to configure your Gmail account to allow access to less secure apps.
You can find this option in your Google account settings under the "Security" section.
There you can find "Allow less secure apps."

案例1:要在Django通过Gmail SMTP发送电子邮件,您需要配置您的Gmail帐户以允许访问安全性较低的应用程序。你可以在你的谷歌账户设置中的“安全”部分找到这个选项。在那里你可以找到“允许安全性较低的应用程序”。


Case2: You might have a typo in your Django Settings.
'Settings' object has no attribute 'EMAIL_HOST_USESR'
The USESR is your typo.

案例2:您可能在Django设置中有一个错字。“Settings”对象没有属性“EMAIL_HOST_USESR "USESR是您的打字错误。


更多回答

I know but it is not possible anymore and Google has disabled this option. but I use 16 password and it is Ok

我知道,但这已经不可能了,谷歌已经禁用了这一选项。但是我用的是16号密码,还可以

@ابراهیمزمانی Check EMAIL_HOST_USESR in your settings, I think you have misspelled "USER" there.

@ابراهیمزمانی检查您的设置中的EMAIL_HOST_USESR,我认为您在那里拼错了“USER”。

@ابراهیمزمانی Anytime mate. Good luck ;)

@ابراهیمزمانیAnytime Mate。祝你好运;)

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com