Ticket #26210: 26210.diff

File 26210.diff, 1.1 KB (added by Tim Graham, 9 years ago)
  • django/core/mail/backends/smtp.py

    diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py
    index 432f3a6..4b05054 100644
    a b class EmailBackend(BaseEmailBackend):  
    3636
    3737    def open(self):
    3838        """
    39         Ensures we have a connection to the email server. Returns whether or
    40         not a new connection was required (True or False).
     39        Ensure an open connection to the email server. Return whether or not a
     40        new connection was required (True or False) or None if an exception
     41        passed silently.
    4142        """
    4243        if self.connection:
    4344            # Nothing to do if the connection is already open.
    class EmailBackend(BaseEmailBackend):  
    9899            return
    99100        with self._lock:
    100101            new_conn_created = self.open()
    101             if not self.connection:
     102            if not self.connection or new_conn_created is None:
    102103                # We failed silently on open().
    103104                # Trying to send would be pointless.
    104105                return
Back to Top