Did I find the right examples for you? yes no

All Samples(14)  |  Call(7)  |  Derive(0)  |  Import(7)
A mail delivery utility that delivers messages synchronously during
transaction commit.

Not useful for production use, but simpler to set up and use.

src/p/r/Products.MailHost-2.13.1/src/Products/MailHost/MailHost.py   Products.MailHost(Download)
from zope.sendmail.mailer import SMTPMailer
from zope.sendmail.maildir import Maildir
from zope.sendmail.delivery import DirectMailDelivery, QueuedMailDelivery, \
                            QueueProcessorThread
 
                delivery = QueuedMailDelivery(self.smtp_queue_directory)
            else:
                delivery = DirectMailDelivery(self._makeMailer())
 
            delivery.send(mfrom, mto, messageText)

src/c/o/collective.overridemailrecipients-1.0.2/src/collective/overridemailrecipients/patches.py   collective.overridemailrecipients(Download)
from email import message_from_string
from zope.component import getUtility
from zope.sendmail.delivery import DirectMailDelivery, QueuedMailDelivery
from plone.registry.interfaces import IRegistry
 
            delivery = QueuedMailDelivery(self.smtp_queue_directory)
        else:
            delivery = DirectMailDelivery(self._makeMailer())
 
        delivery.send(mfrom, mto, messageText)

src/z/o/zope.sendmail-4.0.0a2/src/zope/sendmail/zcml.py   zope.sendmail(Download)
from zope.schema import TextLine, ASCIILine, Int, Bool
 
from zope.sendmail.delivery import QueuedMailDelivery, DirectMailDelivery
from zope.sendmail.interfaces import IMailer, IMailDelivery
from zope.sendmail.mailer import SMTPMailer
            raise ConfigurationError("Mailer %r is not defined" %mailer)
 
        delivery = DirectMailDelivery(mailerObject)
        if permission is not None:
            delivery = _assertPermission(permission, IMailDelivery, delivery)

src/z/o/zope.sendmail-4.0.0a2/src/zope/sendmail/tests/test_delivery.py   zope.sendmail(Download)
    def testInterface(self):
        from zope.sendmail.interfaces import IDirectMailDelivery
        from zope.sendmail.delivery import DirectMailDelivery
        mailer = MailerStub()
        delivery = DirectMailDelivery(mailer)
        verifyObject(IDirectMailDelivery, delivery)
        self.assertEqual(delivery.mailer, mailer)
 
    def testSend(self):
        from zope.sendmail.delivery import DirectMailDelivery
    def testSend(self):
        from zope.sendmail.delivery import DirectMailDelivery
        mailer = MailerStub()
        delivery = DirectMailDelivery(mailer)
        fromaddr = 'Jim <jim@example.com'
    def testBrokenMailerErrorsAreEaten(self):
        from zope.sendmail.delivery import DirectMailDelivery
        mailer = BrokenMailerStub()
        delivery = DirectMailDelivery(mailer)
        fromaddr = 'Jim <jim@example.com'