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.

Source Distribution

takeme_mailgun-1.0.8.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

takeme_mailgun-1.0.8-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

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