This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

mailtools

Writing a web application? Want to send some emails from it? Mailtools can help!

  • Simple API for sending plain text messages, HTML and messages with attachments.
  • ThreadedMailer sends emails in the background and returns control to your application immediately, even when talking to slow remote servers.
  • Temporary sending failures are automatically retried.
  • Running your application in test mode? The RedirectMessages wrapper routes emails to a test address and not to live email addresses.

Usage

Creating a simple SMTP mailer:

from mailtools import SMTPMailer
mailer = SMTPMailer('127.0.0.1')

This mailer will block until messages are sent and won’t retry failures. Use ThreadedMailer to fix this:

mailer = ThreadedMailer(SMTPMailer('127.0.0.1'))

A mailer with TLS/STARTTLS support:

mailer = SMTPMailer('127.0.0.1', 465, transport_args={'security': 'TLS'})
mailer = SMTPMailer('127.0.0.1', transport_args={'security': 'STARTTLS'})

Sending a plain text message:

message = u'This is a plain text message'
mailer.send_plain(
        u'sender@example.com',
        [u'recipient@example.com'],
        u'hi',
        message
)

Sending an HTML message:

message = u'<html><body>Look! HTML!</body></html>'
mailer.send_html(
        u'sender@example.com',
        [u'recipient@example.com'],
        u'hi',
        message
)

Adding attachments:

message = u'index.rst is attached to this message'
mailer.send_plain(
        u'sender@example.com',
        [u'recipient@example.com'],
        u'hi',
        message,
        attachments=['index.rst']
)
Release History

Release History

2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mailtools-2.1.tar.gz (19.7 kB) Copy SHA256 Checksum SHA256 Source Nov 20, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting