Skip to main content

A python client for Mailgun API v3

Project description


[![Code Climate](](
[![Dependency Status](](

A super simple Python API for interacting with [Mailgun](
Currently only supports sending messages. Powered by

Python 3 support should be there but is currently untested.


pip install mailgun2


from mailgun2 import Mailgun
mailer = Mailgun('apikey', '')
['', ''],

Required arguments:
from_email: string of email address to set as sender
to: list or string of email address to send to

Optional arguments:

subject: string subject of the email
text: string body of the email. Either text or html is required.
html: string HTML of the email. Either text or html is required.
cc: list of cc addresses.
bcc: list of bcc addresses.
tags: list of mailgun tags to associate with the email.
reply_to: Convenience argument for setting the Reply-To header
headers: Extra headers for messages
inlines: List of file paths to attach inline to the message
attachments: List of (file name, content type, file handle) as a multipart attachment

Pull requests welcome!

Project details

Download files

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

Source Distribution

mailgun3-0.1.9.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page