This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

email sending for humans

Project Description

Email sending for humans


with pip as easy as:

$ pip install dlvr

or checkout the latest version from github:

$ git clone
$ cd dlvr
$ python install


open a connection to a server:

>>> from dlvr import SMTPServer
>>> s = SMTPServer()

create a email:

>>> from dlvr import Message
>>> m = Message('', ['', ''],
        'testsubject', 'testbody')

send the email:

>>> s.connect()
>>> s.send(m)
>>> s.disconnect()

Full example

from dlvr import SMTPServer, Message

server = SMTPServer(host="", port='587',
    auth_user='MYUSERNAME', auth_pass='MYPASSWOR', tls=True)

## host (optional): defaults to localhost
## port (optional): defaults to 25
## auth_user (optional): your usernamer
## auth_pass (optional): your passwort
## tls (optional): encrypt the session defaults to False

text = 'here is you link:'
subject = 'the link you asked for'

html = """\
        Here is the <a href="">link to google</a> you wanted.

message = Message('', ['', ''],
    subject, text, alternatives=[(html, 'text/html')])

## constructor arguments:

## from_email: required, the senders email
## to: required, a list of recipients
## subject: required, the emails subject
## text_message (optional): the text representation of the email body
## cc (optional): a list of the carbon-copy recipients
## bcc (optional): a list of blind-carbon-copy recipients
## attachments (optional): a list of attachments, and the mimetype to use eg:
##      attachments = [('/tmp/image.jpg', 'image/jpeg'), ('/tmp/song.mp3', 'audio/mpeg3')]
## alternatives (optional): a list of alternative representation of the email body
##      and the mimetype to use
## charset (optional): the charset/encoding to use for text_message, defaults to utf-8

## message functions:

# attach_alternative(content, 'mimetype')
# where mimetype is optional und defaults to 'text/html'

# attach_file('/path/to/file', 'mimetype')
# where mimetype is opional and is guessed if not provided

## send another message with the same open connection ...

## or shorthand if you only send one message:


pull-request please and/or create a issue on github

Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dlvr-0.2.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Aug 22, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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