It merges the Python smtp and email modules, takes a simple configuration before sending the email.
Usage:
Send an email with an attachment.
import mailer
message = mailer.Message()
message.From = "me@example.com"
message.To = "you@example.com"
message.Subject = "My Vacation"
message.Body = open("letter.txt", "rb").read()
message.attach("picture.jpg")
sender = mailer.Mailer('mail.example.com')
sender.send(message)
Use default arguments, multiple recipients"
message = mailer.Message(From="me@example.com",
To=["spam@example.com", "eggs@example.com"],
Subject="My Vacation",
attachments=["picture.jpg"])
message.Body = open("letter.txt", "rb").read()
sender = mailer.Mailer('mail.example.com')
sender.send(message)
Features:
- Single class to send plain text, HTML email, and attachments
- Auto detects attachment types
- Support for internationalized headers
What is new in this release:
- Can now specify MIME type.
What is new in version 0.5:
- Added ability to send HTML emails with attachments.
Comments not found