def send_messages(self, email_messages):
        if not email_messages:
            return
        with self._lock:
            new_conn_created = self.open()
            if not self.connection:
                # We failed silently on open().
                # Trying to send would be pointless.
                return
            num_sent = 0
            for message in email_messages:
                sent = self._send(message)
                if sent:
                    num_sent += 1
            if new_conn_created:
                self.close()
        return num_sent
Sends one or more EmailMessage objects and returns the number of email
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/core/mail/backends/smtp.py/EmailBackend.send_messages