Fetching contributors…
Cannot retrieve contributors at this time
89 lines (64 sloc) 3.41 KB
__version__ = '0.4.10'
__author__ = "Dave Martorana (, Richard Cooper (, Bill Jones (oraclebill), Dmitry Golomidov (deeGraYve)"
__date__ = '2010-April-14'
__url__ = ''
__copyright__ = "(C) 2009-2015 David Martorana, Wildbit LLC, Python Software Foundation."
__doc__ = '''
PMMail object for Postmark (
Version: ''' + __version__ + '''
Author: ''' + __author__ + '''
Last Updated: ''' + __date__ + '''
Make sure you have a Postmark account. Visit to sign up for an account.
Requires a Postmark API key.
Import postmark.PMMail to use Postmark Sending.
Check class documentation on PMMail object for
more information.
Import postmark.PMBatchMail object to send batches of
messages. Either pass a "messages" argument or set
the .messages property of the PMBatchMail object to an
array of PMMail objects.
Import postmark.PMBounceManager to use Postmark Bounce API.
Check class documentation on PMBounceManager object for
more information.
The library can be used stand-alone with Django. You can also
add the setting
POSTMARK_API_KEY = 'your-key'
to your file, and when you create a new PMMail object,
it will grab the API key automatically.
Using POSTMARK_TEST_MODE=True will not actually send the email, but
instead dump the JSON packet that would be sent to
By default this setting is False, and if not specified, will
be assumed to be False.
To reroute all Django E-Mail functions like send_mail() and
mail_admins() through postmark use the following setting:
EMAIL_BACKEND = 'postmark.django_backend.EmailBackend'
But keep in mind that even when using standard Django functions
the sender must be registered with
One of the required values for attempting a send request is missing
Base Postmark send exception
401: Unauthorized sending due to bad API key
422: Unprocessable Entity - usually an exception with either the sender
not having a matching Sender Signature in Postmark. Read the message
details for further information
500: Internal error - this is on the Postmark server side. Errors are
logged and recorded at Postmark.
A URLError was caught - usually has to do with connectivity
and the ability to reach the server. The inner_exception will
have the base URLError object.
Add automatic multipart emails via regex stripping of HTML tags from html_body
if the .multipart property is set to True
from .core import *