Skip to main content

Dramatically simplify sending email from your python app

Project description

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.

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',
    ['mary@example.com', 'bob@example.com']
)
email_msg.attach("picture.jpg")
messages.append(email_msg)

…

mailer.send_messages(messages)
Mailers availiable:
  • SMTPMailer

  • AmazonSESMailer

and:

  • ToConsoleMailer (prints the emails in the console)

  • ToFileMailer (save the emails in a file)

  • ToMemoryMailer (for testing)

  • DummyMailer (does nothing)

copyright:

Juan-Pablo Scaletti.

license:

MIT, see LICENSE for more details.

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-0.16.1.tar.gz (16.7 kB view details)

Uploaded Source

File details

Details for the file MailShake-0.16.1.tar.gz.

File metadata

  • Download URL: MailShake-0.16.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for MailShake-0.16.1.tar.gz
Algorithm Hash digest
SHA256 b6f787cdac594a5afd97ccf5a3661d9b0abcfd77ee8920ba6c248e4924dec84e
MD5 3caab4329a7a9fb1e69b53620b669e3a
BLAKE2b-256 fa618e1feb71f9a8a3bccd5767c771f9e6d8e28895cf6f8b2c42ebf91734f539

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