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
Examples
Sending an HTML email:
from mailer import Mailer from mailer import Message message = Message(From="me@example.com", To="you@example.com", charset="utf-8") message.Subject = "An HTML Email" message.Html = """This email uses <strong>HTML</strong>!""" message.Body = """This is alternate text.""" sender = Mailer('smtp.example.com') sender.send(message)
Sending an attachment:
from mailer import Mailer from mailer import Message message = Message(From="me@example.com", To="you@example.com", Subject="Cute Cat") message.Body = """Kittens with dynamite""" message.attach("kitty.jpg") sender = Mailer('smtp.example.com') sender.send(message)
Tested with Python 2.4 and 2.5
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mailer-0.2.zip
(3.0 kB
view hashes)
Built Distribution
mailer-0.2.win32.exe
(64.6 kB
view hashes)