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