MCPcopy
hub / github.com/django/django / _send

Method _send

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

A helper method that does the actual sending.

(self, email_message)

Source from the content-addressed store, hash-verified

187 return num_sent
188
189 def _send(self, email_message):
190 """A helper method that does the actual sending."""
191 if not email_message.recipients():
192 return False
193 from_email = self.prep_address(email_message.from_email)
194 recipients = [self.prep_address(addr) for addr in email_message.recipients()]
195 message = email_message.message(policy=email.policy.SMTP)
196 try:
197 self.connection.sendmail(from_email, recipients, message.as_bytes())
198 except smtplib.SMTPException:
199 if not self.fail_silently:
200 raise
201 return False
202 return True
203
204 def prep_address(self, address, force_ascii=True):
205 """

Callers 1

send_messagesMethod · 0.95

Calls 4

prep_addressMethod · 0.95
recipientsMethod · 0.80
messageMethod · 0.80
as_bytesMethod · 0.80

Tested by

no test coverage detected