Skip to main content

Python Wrapper for Mailgun API

Project description

takeme-mailgun

This module provides wrapper for Mailgun APIs.

Installation

pip install takeme-mailgun

Usage

import takeme_mailgun

API_KEY = 'xxxxxxxxxxxx'
DOMAIN = 'xxx.abc.jp'
EMAIL = 'hr@abc.jp'
MAIL_FROM = 'from@abc.jp'
MAIL_SUBJECT = 'Test Mail'
MAIL_BODY = 'Hello World'    

mailgun = takeme_mailgun.Mailgun(DOMAIN, API_KEY)
mailgun.mail_from = MAIL_FROM
if mailgun.is_valid(EMAIL):
    mailgun.messages(EMAIL, MAIL_SUBJECT, '', MAIL_BODY)
else:
    print('[{}] is an ivalid email.'.format(EMAIL))

if mailgun.is_delivered(EMAIL):
    print('[{}] is delivered successfully.'.format(EMAIL))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for takeme-mailgun, version 1.0.8
Filename, size File type Python version Upload date Hashes
Filename, size takeme_mailgun-1.0.8-py3-none-any.whl (15.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size takeme_mailgun-1.0.8.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page