Created
October 14, 2014 00:27
-
-
Save Gexos/5a6789c281b0d80a305f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
request=requests.post( | |
'https://api.mailgun.net/v2/samples.mailgun.org/messages', | |
auth=("api", "key-3ax6xnjp29jd6fds4gc373sgvjxteol0"), | |
files=[("attachment", open("test.jpg"))], | |
data={"from":"foo@example.com", | |
"to": "bar@example.com", | |
"subject": "Hello", | |
"text": "Testing some Mailgun awesomness!", | |
"html": 'HTML version of the body'}) | |
print 'Status: {0}'.format(request.status_code) | |
print 'Body: {0}'.format(request.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment