code: def send_messages(self, emails):
          
          num_sent = 0
          for e in emails:
              html = None
              if isinstance(e, EmailMultiAlternatives):
                  for a in e.alternatives:
                      if a[1] == 'text/html':
                          html = a[0]
              r = self._connection.send(
                  from_=e.from_email,
                  to=e.to,
                  subject=e.subject,
                  text=e.body,
                  html=html,
                  cc=e.cc,
                  bcc=e.bcc,
                  attachments=list(self._process_attachments(e)),
              )
              if 'error' not in r:
                  num_sent += 1
          return num_sent
docs: Attempt to send the specified emails.