[Answered ]-Django. Getting "ConnectionRefusedError: [Errno 111" when trying to send an email

0👍

It was just a typo in the settings.py file’s line which specify a SMTP host: EMAIL_HOSTS = 'smtp.gmail.com' instead of EMAIL_HOST = 'smtp.gmail.com'. So Django used the default EMAIL_HOST parameter – localhost and was failing to connect. Thanks people in comments that tried to help me.

1👍

it helped me to add in settingd.py:

RECIPIENTS_EMAIL = ['manager@mysite.com']   # замените на свою почту
DEFAULT_FROM_EMAIL = 'admin@mysite.com'  # замените на свою почту
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
👤Vadim

Leave a comment