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)
示例#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
示例#3
0
文件: message.py 项目: mbbui/Jminee
 def send(self):
     return interface.send(self)
示例#4
0
 def send(self):
     interface.send(self)
示例#5
0
文件: __init__.py 项目: mbbui/Jminee
def send(message):
    '''Send a message via TurboMail.'''
    
    return interface.send(message)