2017-11-20 5 views
0

Ich bekomme eine Verbindung Timeout Fehler, wenn ich versuche, eine Django-Mail über SMTP senden. Im Folgenden finden Sie meine Konfiguration -Verbindung Zeitüberschreitung Fehler beim Senden einer SMTP-Mail durch zoho

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 

# Host for sending e-mail. 
EMAIL_HOST = 'smtp.zoho.com' 

# Port for sending e-mail. 
EMAIL_PORT = 587 

# Optional SMTP authentication information for EMAIL_HOST. 
EMAIL_HOST_USER = '[email protected]' 
EMAIL_HOST_PASSWORD = 'amaze123' 
EMAIL_USE_TLS = True 

Und der Code, ist bin mit:

from django.core.mail import send_mail 
    >>> send_mail('Order Confirmation', 'Order placed successfuly', 
'[email protected]', ['[email protected]']) 

Fehler -

Traceback (most recent call last): 
    File "<console>", line 1, in <module> 
    File "/usr/local/lib/python2.7/dist-packages/django/core/mail/__init__.py", li                      ne 61, in send_mail 
    return mail.send() 
    File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", lin                      e 292, in send 
    return self.get_connection(fail_silently).send_messages([self]) 
    File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py                      ", line 100, in send_messages 
    new_conn_created = self.open() 
    File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py                      ", line 58, in open 
    self.connection = connection_class(self.host, self.port, **connection_params                      ) 
    File "/usr/lib/python2.7/smtplib.py", line 256, in __init__ 
    (code, msg) = self.connect(host, port) 
    File "/usr/lib/python2.7/smtplib.py", line 316, in connect 
    self.sock = self._get_socket(host, port, self.timeout) 
    File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket 
    return socket.create_connection((host, port), timeout) 
    File "/usr/lib/python2.7/socket.py", line 571, in create_connection 
    raise err 
error: [Errno 110] Connection timed out 

Antwort

-1

Sind Sie sicher, dass Sie benötigen die Verwendung von TLS und SSL, und bei Bedarf haben Sie SMTP auf Ihrem E-Mail-Konto aktiviert?

Verwandte Themen