Email Sends In Development But Not In Production

164 Views Asked by At

I am able to send these automated emails through Dajngo while in my production environment, though in development I get the error

[Errno 101] Network is unreachable
Exception Location: /opt/alt/python38/lib64/python3.8/socket.py in create_connection, line 796

My settings

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-mail.outlook.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'email.email@email'
EMAIL_HOST_PASSWORD = 'password'
SERVER_EMAIL = EMAIL_HOST_USER
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

I think the connection is being refused by Outlook, however it's accepted in my development environment (I used powershell to enable SMTP AUTH).

PS - I have tried different port numbers.

Any help would be greatly appreaciated.

Thank you.

1

There are 1 best solutions below

0
On

To anyone having similar difficulties. The problem was that A2 Hosting doesn't allow smtp. I am currently working on finding a workaround. Il update this once i figure it out. If i forget and your stuck, drop me a msg and il tell u how i end up fixing it.