MCPcopy
hub / github.com/django/django / close

Method close

django/core/mail/backends/smtp.py:146–163  ·  view source on GitHub ↗

Close the connection to the email server.

(self)

Source from the content-addressed store, hash-verified

144 raise
145
146 def close(self):
147 """Close the connection to the email server."""
148 if self.connection is None:
149 return
150 try:
151 try:
152 self.connection.quit()
153 except (ssl.SSLError, smtplib.SMTPServerDisconnected):
154 # This happens when calling quit() on a TLS connection
155 # sometimes, or when the connection was already disconnected
156 # by the server.
157 self.connection.close()
158 except smtplib.SMTPException:
159 if self.fail_silently:
160 return
161 raise
162 finally:
163 self.connection = None
164
165 def send_messages(self, email_messages):
166 """

Callers 7

send_messagesMethod · 0.95
send_messagesMethod · 0.95
write_migration_filesMethod · 0.45
handleMethod · 0.45
load_labelMethod · 0.45
handleMethod · 0.45
inner_runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected