Issue
Getting error "Connection unexpectedly closed" both through site and shell.
Code: Settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.live.com'
DEFAULT_FROM_EMAIL = '[email protected]'
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = 'Hunter2'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
Views.py:
send_mail(
'Test',
'test',
'[email protected]',
['[email protected]'],
fail_silently=False,
)
Any help would be greatly appreciated. Thanks in advance
Solution
It is likely that your host is blocking that port. Your settings.py looks fine. I would refer to your hosting provider to ensure that they allow the use of that port.
Answered By - Daniel Reidy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.