A python client for Mailgun API v2
Project description
Originally at https://github.com/ZeroCater/python-mailgun2
A super simple Python API for interacting with Mailgun. Currently only supports sending messages. Powered by Requests.
Python 3 support should be there but is currently untested.
Installation
pip install mailgun2
Usage
from mailgun2 import Mailgun
mailer = Mailgun('example.mailgun.org', 'public_key', 'private_key')
mailer.send_message(
'from@yourdomain.com',
['to@you.com', 'others@you.com'],
subject='Hi!',
text='Sweet.'
)
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
Contributing
See Contributing
Pull requests welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mailgun2-1.0.0.tar.gz
(4.4 kB
view details)
File details
Details for the file mailgun2-1.0.0.tar.gz
.
File metadata
- Download URL: mailgun2-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cdd99641238fd3576f649ca62d69e0883d81a455f72ec2af0ddd60c887fbda1 |
|
MD5 | 3acae66173a61352d8f25de0943cc002 |
|
BLAKE2b-256 | 1f8b8fffba23ca7a06ecae52ff01483790e8cd6f2ec4485e561cc83ec33e8f86 |