Skip to main content

Maildocker library for Python

Project description

This library allows you to quickly and easily send emails through Maildocker using Python.

Example

import maildocker

md = maildocker.MaildockerClient(
    api_key='0cc175b9c0f1b6a831c',
    api_secret='92eb5ffee6ae2fec3ad'
)

message = maildocker.Mail(
    mail_from='Maildocker <maildocker@ecentry.io>',
    to='John Snow <john.snow@thrones.com>',
    subject='maildocker-python-library',
    text='**{{system}}** ({{url}})',
    merge_vars={'system': 'Maildocker', 'url': 'http://maildocker.io'},
    attachments=[
        {'name': 'plaintext.txt', 'type': 'text/plain', 'content': 'dHN0'},
        'spreadsheet.xls'
    ]
)

http_status, response = md.send(message)

# OR

message = maildocker.Mail()

message.set_from('Maildocker <maildocker@ecentry.io>')
message.add_to('John Snow <john.snow@thrones.com>')
message.set_subject('maildocker-python-library')
message.set_text('**{{system}}** ({{url}})')
message.add_vars({'system': 'Maildocker', 'url': 'http://maildocker.io'})
message.add_attachment([
    {'name': 'plaintext.txt', 'type': 'text/plain', 'content': 'dHN0'},
    'spreadsheet.xls'
])

http_status, response = md.send(message)

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
maildocker-1.0.1.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Oct 14, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page