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)
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
def send(self): return interface.send(self)
def send(self): interface.send(self)
def send(message): '''Send a message via TurboMail.''' return interface.send(message)