(self, message_or_messages)
Sends a single messsage or multiple messages.

        :param message_or_messages: one message instance or one iterable of
                                    message instances.
Sends a single messsage or multiple messages.
Sends a single messsage or multiple messages .
def send(self, message_or_messages):
        """Sends a single messsage or multiple messages.

        :param message_or_messages: one message instance or one iterable of
                                    message instances.
        """
        try:
            messages = iter(message_or_messages)
        except TypeError:
            messages = [message_or_messages]

        with self.connection as c:
            for message in messages:
                if self.fromaddr and not message.fromaddr:
                    message.fromaddr = self.fromaddr
                message.validate()
                c.send(message)
def send ( self , message_or_messages ) : try : messages = iter ( message_or_messages ) except TypeError : messages = [ message_or_messages ] with self . connection as c : for message in messages : if self . fromaddr and not message . fromaddr : message . fromaddr = self . fromaddr message . validate ( ) c . send ( message )