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.
Works with Python 3!
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!
Distributing
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*
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.1.1.tar.gz
(7.1 kB
view details)
Built Distribution
File details
Details for the file mailgun2-1.1.1.tar.gz
.
File metadata
- Download URL: mailgun2-1.1.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 649a76d414b22cc986f19ca2b2c03c0f4454211f91cdee49b00d203500807672 |
|
MD5 | 9fffa9a11bba0bd25e23a374e584da9d |
|
BLAKE2b-256 | 3deefd97aff5aed9c7785250a349c6779f34f1ca73d42160cca92f007cf7719a |
File details
Details for the file mailgun2-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: mailgun2-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63389c31b647fc54aade5e63ab46ea5c275fa618fecd10d805dee58db51bc95 |
|
MD5 | 2aa9ee2297e87707ccbe88fdd8659460 |
|
BLAKE2b-256 | 5074c49d846aa797593217a59dcbd3d4f6a1fb7eeb021b307bb0fab8d3e9973c |