Skip to main content
Help us improve Python packaging – donate today!

A module that simplifies sending email.

Project Description

Here are some of the features:

  • Single class to send plain text, HTML email, and attachments
  • Auto detects attachment types
  • Support for internationalized headers

Changes in version 0.3

The API for Mailer.To is changed. Use a string to specify a single recipient, and an iterable to specify more than one.

Changes in version 0.4

You can now specify the port in Mailer

from mailer import Mailer
sender = Mailer('', port=20)

Changes in version 0.5

  • Message.attach takes an optional cid argument.
  • You can now send HTML emails with attachments

Thanks to Douglas Mayle for his patch for this.


Sending an HTML email:

from mailer import Mailer
from mailer import Message

message = Message(From="",
message.Subject = "An HTML Email"
message.Html = """This email uses <strong>HTML</strong>!"""
message.Body = """This is alternate text."""

sender = Mailer('')

Sending an attachment:

from mailer import Mailer
from mailer import Message

message = Message(From="",
                  To=["", ""],
                  Subject="Cute Cat")
message.Body = """Kittens with dynamite"""

sender = Mailer('')

Tested with Python 2.4 and 2.5

Release history Release notifications

History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mailer-0.5.win32.exe (64.8 kB) Copy SHA256 hash SHA256 Windows Installer any May 28, 2009 (3.2 kB) Copy SHA256 hash SHA256 Source None May 28, 2009

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page