在我的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,如果你也可以帮我这个。
答案 0 :(得分:0)
您尚未将电子邮件密码添加到settings.py
EMAIL_HOST_PASSWORD = 'my email account password'