【问题标题】:Django : Configuration emailsDjango:配置电子邮件
【发布时间】:2015-11-13 23:32:10
【问题描述】:

在我的 settings.py 中:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yahoo.fr'
EMAIL_PORT = 25
EMAIL_HOST_USER = "myusername@yahoo.fr"
DEFAULT_FROM_EMAIL = "myusername@yahoo.fr"

我的命令:

from django.core.mail import send_mail
send_mail('sss','hhh','myusername@outlook.fr',['myusername@yahoo.fr'])

错误:

...
error: [Errno 111] Connection refused

为什么? 我不确定我的 settings.py 配置是否正确,如果您也可以为此提供帮助。

【问题讨论】:

    标签: django


    【解决方案1】:

    你还没有在settings.py中添加邮箱密码

    EMAIL_HOST_PASSWORD = 'my email account password'
    

    【讨论】:

    • 谢谢!我已经添加了这个,我配置了我的 Gmail 帐户的应用程序密码,它的工作原理!但是现在我的系统使用'send_mail'有一个很大的问题,我在这里解释一下:stackoverflow.com/questions/33702434/…
    猜你喜欢
    • 2013-05-05
    • 2017-02-22
    • 1970-01-01
    • 2013-11-13
    • 1970-01-01
    • 2014-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多