Skip to main content

Dramatically simplify sending email from your python app.

Project description

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.

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

mailshake-2.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

mailshake-2.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file mailshake-2.2.tar.gz.

File metadata

  • Download URL: mailshake-2.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mailshake-2.2.tar.gz
Algorithm Hash digest
SHA256 43ab1ff4074dd8951f98ef1b08a7d5a287d2e0eff4961cab8fe8b765189d71fa
MD5 db167658130d11477c1927c4bcce8edd
BLAKE2b-256 25f1b3a53d92d3daba580486e24b445d246c1956440a1ce2bf9bcff9b1f0a904

See more details on using hashes here.

File details

Details for the file mailshake-2.2-py3-none-any.whl.

File metadata

  • Download URL: mailshake-2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for mailshake-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a84fd9260b5492757217c74b694724bf8c4a23c28c2af181c8932e41071b40d5
MD5 daf1a78c72e27fb0a2820652d6d8a420
BLAKE2b-256 898d2dee1b3e9f056dd798c040d2e96326c4a83ba3366c6fd7e1df3da0767308

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page