Skip to main content

Python client library for Postmark API

Project description


Build Coverage Version Python versions Documentation Status Gitter License

Python client library for Postmark API.



Postmarker can be obtained with pip:

$ pip install postmarker

Usage example


The attributes of all classes are provided as is, without transformation to snake case. We don’t want to introduce new names for existing entities.

Send single email:

>>> from postmarker.core import PostmarkClient
>>> postmark = PostmarkClient(server_token='API_TOKEN')
>>> postmark.emails.send(
    Subject='Postmark test',
    HtmlBody='<html><body><strong>Hello</strong> dear Postmark user.</body></html>'

Send batch:

>>> postmark.emails.send_batch(
        'From': '',
        'To': '',
        'Subject': 'Postmark test',
        'HtmlBody': '<html><body><strong>Hello</strong> dear Postmark user.</body></html>',
        'From': '',
        'To': '',
        'Subject': 'Postmark test 2',
        'HtmlBody': '<html><body><strong>Hello</strong> dear Postmark user.</body></html>',

Setup an email:

>>> email = postmark.emails.Email(
    Subject='Postmark test',
    HtmlBody='<html><body><strong>Hello</strong> dear Postmark user.</body></html>'
>>> email['X-Accept-Language'] = 'en-us, en'
>>> email.attach('/home/user/readme.txt')
>>> email.attach_binary(content=b'content', filename='readme.txt')
>>> email.send()

There are a lot of features available. Check it out in our documentation! Here’s just a few of them:

  • Support for sending Python email instances.
  • Bounces, Domains, Messages, Templates, Sender signatures, Status, Stats & Server API.
  • Django email backend.
  • Tornado helper.
  • Spam check API.
  • Wrappers for Bounce, Inbound, Open and Delivery webhooks.


You can view the documentation online at:

Or you can look at the docs/ directory in the repository.

Python support

Postmarker supports Python 3.6 - 3.9 and PyPy3.


Many thanks to Shmele and lobziik for their reviews and advices :)

Project details

Download files

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

Files for postmarker, version 0.18.2
Filename, size File type Python version Upload date Hashes
Filename, size postmarker-0.18.2-py3-none-any.whl (24.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size postmarker-0.18.2.tar.gz (20.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page