Dramatically simplify sending email from your python app.
Project description
Mailshake
Although Python makes sending email relatively easy via the smtplib module, this library provides a couple of light wrappers over it.
These wrappers make sending email extra quick, easy to test email sending during development, and provides support for platforms that can't use SMTP.
Mailers availiable:
- SMTPMailer
- AmazonSESMailer
- ToConsoleMailer (prints the emails in the console)
- ToFileMailer (save the emails in a file)
- ToMemoryMailer (for testing)
- DummyMailer (does nothing)
Usage:
from mailshake import SMTPMailer
mailer = SMTPMailer()
mailer.send(
subject='Hi',
text_content='Hello world!',
from_email='from@example.com',
to=['mary@example.com', 'bob@example.com']
)
You can also compose several messages and send them at the same time:
from mailshake import SMTPMailer, EmailMessage
mailer = SMTPMailer()
messages = []
email_msg = EmailMessage(
"Weekend getaway",
"Here's a photo of us from our trip.",
"from@example.com",
"bob@example.com"
)
email_msg.attach_file("picture.jpg")
messages.append(email_msg)
#…
mailer.send_messages(*messages)
Install for development
First, create an activate a virtualenv. eg:
python -m virtualenv .venv
source .venv/bin/activate
Then run pip install -e .[dev]
or make install
. This will install the library in editable mode and all its dependencies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mailshake-2.3.tar.gz
.
File metadata
- Download URL: mailshake-2.3.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fd4f2b49419a363374008c15b2ce2c3342a0d06d0d7c7cfb37dd989e62f0e4f |
|
MD5 | 3c679ab54091e15b148671cc95b3123a |
|
BLAKE2b-256 | c6fbe67ddb075a95c090f9177d3eddde6990a34f290501403b113475b522f7e7 |
File details
Details for the file mailshake-2.3-py3-none-any.whl
.
File metadata
- Download URL: mailshake-2.3-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4e0b71abb5b61f105f5d5a966d7131790aeecf86d94bba7b92ff0b1ed2629e4 |
|
MD5 | 061dbfbc892186a480c4f1a1c55fc1c7 |
|
BLAKE2b-256 | 05b15a9e321c666c0cbe49db2e28732771ce02a7c2f86c0824db5f43a80f8fd5 |