A python client for Mailgun API v2
Project description
python-mailgun2
===============
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!
===============
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.3.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
mailgun2-0.1.3.linux-x86_64.exe
(64.5 kB
view details)
File details
Details for the file mailgun2-0.1.3.tar.gz.
File metadata
- Download URL: mailgun2-0.1.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f66e4ac65e11814398b95a6b9dee1e106a2f30279de36878a55fb64a53a7c4de
|
|
| MD5 |
0f3c4fffafd058d79994069346a3f9c9
|
|
| BLAKE2b-256 |
d2b0d6d4eb9aaff5535c395c653ac508dacb6bec0406ff7cfd8d9f97427829d3
|
File details
Details for the file mailgun2-0.1.3.linux-x86_64.exe.
File metadata
- Download URL: mailgun2-0.1.3.linux-x86_64.exe
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdb7502921d0bb9a0d5f9fa96e86262744192b1c1426e9212dbf997aa769a3f0
|
|
| MD5 |
28e16d5d456212132ee8c196c231258b
|
|
| BLAKE2b-256 |
da8cdb3c0d2e0f1ea9e0c24b81676c608abad6ed5bcace06077d64955e49d698
|