Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Mailer
✓ from zope.sendmail.mailer import SMTPMailer
✗ from zope.sendmail import SMTPMailer
Direct import from top-level package fails; use full path.
QueueMailDelivery
✓ from zope.sendmail.delivery import QueueMailDelivery
✗ from zope.sendmail import QueueMailDelivery
Same as above - specify submodule.
Send an email directly via SMTP without queuing.
from zope.sendmail.mailer import SMTPMailer
from zope.sendmail.delivery import DirectMailDelivery
mailer = SMTPMailer('smtp.example.com', port=25)
delivery = DirectMailDelivery(mailer)
from email.message import EmailMessage
msg = EmailMessage()
msg['From'] = 'sender@example.com'
msg['To'] = 'recipient@example.com'
msg['Subject'] = 'Test'
msg.set_content('Hello')
delivery.send('sender@example.com', ['recipient@example.com'], msg)
print('Email sent.')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'zope.sendmail'
Package name is zope.sendmail (with dot), but pip install zope-sendmail. Some users try import zope_sendmail.
fixRun 'pip install zope.sendmail' and import as 'zope.sendmail'.
AttributeError: module 'zope.sendmail' has no attribute 'SMTPMailer'
Attempting to import from top-level instead of submodule.
fixUse 'from zope.sendmail.mailer import SMTPMailer'.
Upgrade
Version history
7.1.1latest on PyPI · released Jun 3, 2026
Audit
Dependencies
zope.interfacerequiredCore dependency for interface definitions
zope.componentoptionalRequired for utility registration (e.g., IMailDelivery)