Forums

SMTP Connection refused error

Hello there, I am trying to send an email but I get connection refused error. Below are my email settings, which are working fine on localhost. I think maybe I get this error because "smtppro.zoho.eu" is not whitelisted on your website? If so, can you help? Here is link to their API documentation: https://www.zoho.com/mail/help/zoho-smtp.html

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "smtppro.zoho.eu"
EMAIL_PORT = 587
EMAIL_HOST_USER = "horatiu.radutiu@hawking.ro"
EMAIL_HOST_PASSWORD = 'xxxxxxxxxx'
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False

Error

  File "/usr/lib/python3.8/smtplib.py", line 253, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.8/smtplib.py", line 339, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.8/smtplib.py", line 308, in _get_socket
    return socket.create_connection((host, port), timeout,
  File "/usr/lib/python3.8/socket.py", line 807, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Thank you!

See https://help.pythonanywhere.com/pages/SMTPForFreeUsers/

I see, and I also see that you already whitelisted a couple of APIs from zoho. Is there a chance that you can whitelist smtppro.zoho.eu, the one that I need? Thanks!

Send us official documentation of that API endpoint and we'll see what we can do.

Thank you @pafk. This is it https://www.zoho.com/mail/help/zoho-smtp.html

It's not an API endpoint, it's an SMTP server -- free users can use only HTTP protocol.