A python client for Mailgun API v2
Project description
python-mailgun2
===============
[![Code Climate](https://codeclimate.com/github/ZeroCater/python-mailgun2/badges/gpa.svg)](https://codeclimate.com/github/ZeroCater/python-mailgun2)
[![Dependency Status](https://gemnasium.com/almlab/adaptml.svg)](https://gemnasium.com/almlab/adaptml)
A super simple Python API for interacting with [Mailgun](http://www.mailgun.com/).
Currently only supports sending messages. Powered by
[Requests](http://docs.python-requests.org/en/latest/).
Python 3 support should be there but is currently untested.
Installation:
```shell
pip install mailgun2
```
Usage:
```python
from mailgun2 import Mailgun
mailer = Mailgun('apikey', 'example.mailgun.org')
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
```
Pull requests welcome!
===============
[![Code Climate](https://codeclimate.com/github/ZeroCater/python-mailgun2/badges/gpa.svg)](https://codeclimate.com/github/ZeroCater/python-mailgun2)
[![Dependency Status](https://gemnasium.com/almlab/adaptml.svg)](https://gemnasium.com/almlab/adaptml)
A super simple Python API for interacting with [Mailgun](http://www.mailgun.com/).
Currently only supports sending messages. Powered by
[Requests](http://docs.python-requests.org/en/latest/).
Python 3 support should be there but is currently untested.
Installation:
```shell
pip install mailgun2
```
Usage:
```python
from mailgun2 import Mailgun
mailer = Mailgun('apikey', 'example.mailgun.org')
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
```
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-0.1.4.tar.gz
(3.0 kB
view details)
Built Distribution
mailgun2-0.1.4-py2.7.egg
(4.3 kB
view details)
File details
Details for the file mailgun2-0.1.4.tar.gz
.
File metadata
- Download URL: mailgun2-0.1.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3efe36958685ef1e95c4e8972d12e6a3cc0cd9990263a3636dd26b9cc494afa |
|
MD5 | 5632c8748c9eb52ae10fbf921a1667ab |
|
BLAKE2b-256 | 6c7c891e5da8361a909ba83a2706c56bc06b61c15260190e495c4bb404b6a588 |
File details
Details for the file mailgun2-0.1.4-py2.7.egg
.
File metadata
- Download URL: mailgun2-0.1.4-py2.7.egg
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17e2ac71e7552fa34e707aaa9967653a7aec70b28cfeb278db9d50de1152e3fa |
|
MD5 | 328e8108e84e96266095dbf7a0d32c79 |
|
BLAKE2b-256 | b8f9ec1973a862def5a36f64d05052fc4b26ffbb1c3dfe460351f371b29e9cce |