def test_provide_dict_with_additional_managers_and_transports_which_overrides_setuptools(self):
     config = self.config.copy()
     config.update({'mail.manager': 'immediate', 'mail.transport': 'foo',})
     interface.start(config, extra_classes=dict(immediate=self.manager, foo=self.transport))
     self.assertEqual(self.manager, interface.manager)
     self.assertEqual(self.transport, interface.transport)
     interface.send(self.message)
Beispiel #2
0
 def sendmail(self, subject, to, text=None, attachments=()):
     message = Message(encoding="utf-8")
     message.author = self.AUTHOR
     message.subject = subject
     message.to = to
     if text is None:
         text = " "
     message.plain = text
     for name, attachment in attachments:
         message.attach(StringIO(attachment), name)
     tries = 2
     while tries > 0:
         try:
             interface.send(message)
         except socket_error:
             tries -= 1
             if not tries:
                 raise
         else:
             break
Beispiel #3
0
 def send(self):
     return interface.send(self)
Beispiel #4
0
 def send(self):
     interface.send(self)
Beispiel #5
0
def send(message):
    '''Send a message via TurboMail.'''
    
    return interface.send(message)