Skip to main content

A python client for Mailgun API v2

Project description

PyPI

Codeship Status for albertyw/python-mailgun2 Code Climate Code Climate Test Coverage Dependency Status

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!

Project details


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.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

mailgun2-1.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file mailgun2-1.1.0.tar.gz.

File metadata

  • Download URL: mailgun2-1.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mailgun2-1.1.0.tar.gz
Algorithm Hash digest
SHA256 91330225c8d740866dcc457e7e939e41c126039f3ad91bf2dc8d584edbc5760d
MD5 d48a03630e047272738696162260ee25
BLAKE2b-256 08772d055016e874b5dd78a072356aee461a873021394a98db814daa1f409e68

See more details on using hashes here.

File details

Details for the file mailgun2-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mailgun2-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2cf69349f0a00aaf6ee6fea0223ea0703742818423f913f573f1dbead816a02
MD5 ff7c98a2c7045ad2458ad89524dcb5b5
BLAKE2b-256 f9dd6f65c4408798e7266d7999be449b4bf96e8cee65f2959d3138f51d030594

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page