Skip to main content

Mailshake logo

Mailshake

Build Status

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.

Metadata

Release files for mailshake 2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailshake 2.3
File Size Uploaded
mailshake-2.3.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mailshake 2.3
File Interpreter ABI Platform
mailshake-2.3-py3-none-any.whl Python 3 none any Details

Total release size: 36.3 kB

Release files / mailshake-2.3.tar.gz

Download URL mailshake-2.3.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7fd4f2b49419a363374008c15b2ce2c3342a0d06d0d7c7cfb37dd989e62f0e4f
BLAKE2b-256 checksum
How to use checksums
c6fbe67ddb075a95c090f9177d3eddde6990a34f290501403b113475b522f7e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / mailshake-2.3-py3-none-any.whl

Download URL mailshake-2.3-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4e0b71abb5b61f105f5d5a966d7131790aeecf86d94bba7b92ff0b1ed2629e4
BLAKE2b-256 checksum
How to use checksums
05b15a9e321c666c0cbe49db2e28732771ce02a7c2f86c0824db5f43a80f8fd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

2.3 This release

2 release files

2.2

2 release files

2.1

2 release files

0.17.0

1 release file

0.16.1

1 release file

0.16.0

1 release file

0.15.0

1 release file

0.14.0

1 release file

0.13.0

1 release file

0.12.8

1 release file

0.12.7

1 release file

0.12.6

1 release file

0.12.5

1 release file

0.12.4

1 release file

0.12.3

1 release file

0.12.2

1 release file

0.12.1

1 release file

0.12.0

1 release file

0.11.2

1 release file

0.11.1

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page