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('smtp.example.com', 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.
Changes in version 0.6
Can now select port
Supports gmail
Changes in version 0.7
You can now specify MIME type:
msg.attach("picture.png", mimetype="image/png")
Changes in version 0.8
Various bug fixes
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, 2.5, and 2.6
Metadata
Release files for mailer 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mailer-0.8.1.zip | 6.5 kB | Without provenance | Details for mailer-0.8.1.zip |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mailer-0.8.1.win32.exe | Details for mailer-0.8.1.win32.exe |
Total release size: 208.6 kB
Release files / mailer-0.8.1.zip
| Download URL | mailer-0.8.1.zip |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3411a12197731e0d5379ab194d9acc8d0d71c8b95fdfb11474d67c3e9860070e
|
|
BLAKE2b-256 checksum How to use checksums |
30e7c3a932fc03ab95c96ff911d8ee3e89b937205596a5c1f00849401a2468e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / mailer-0.8.1.win32.exe
| Download URL | mailer-0.8.1.win32.exe |
|---|---|
| Size | 202.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a66ab3de3c77e36d4ef744a03d6ee24271546a786580020bb226b7cea65843e
|
|
BLAKE2b-256 checksum How to use checksums |
8c1264abb34c14d2bbb27e0c08dcaa9afccc8abb2e6c7945377d73291ea44d97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mailer 0.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.