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)
Here are some key features of "mailer":
· Single class to send plain text, HTML email, and attachments
· Auto detects attachment types
· Support for internationalized headers
What's New in This Release: [ read full changelog ]
· Can now specify MIME type.