Skip to main content

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.

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", "him@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.3.zip (3.0 kB view details)

Uploaded Source

Built Distribution

mailer-0.3.win32.exe (64.6 kB view details)

Uploaded Source

File details

Details for the file mailer-0.3.zip.

File metadata

  • Download URL: mailer-0.3.zip
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mailer-0.3.zip
Algorithm Hash digest
SHA256 2fb818e8309e3fd2a99a638e22100f1dfabc144ce144491e05c1514949af7c41
MD5 5eafd6fccc01e7dbb56337f46dd443e3
BLAKE2b-256 8cc863529829e1ba9c83f8fdc54eabd011de0f7ab361e84e9107e37c5cdd1c7f

See more details on using hashes here.

File details

Details for the file mailer-0.3.win32.exe.

File metadata

  • Download URL: mailer-0.3.win32.exe
  • Upload date:
  • Size: 64.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mailer-0.3.win32.exe
Algorithm Hash digest
SHA256 47ae6888b3ffafc5813198fa8d1eaaccae0f7af13d019fb117639734978685f9
MD5 a46757c2e3deffc29779aeb92a9236ea
BLAKE2b-256 dd4e3a792aded557e24c69e416eb601321d9db3b668dc9f635388a53fedf4879

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page