Skip to main content

API wrapper for Temp Mail API.

Project description

tempmailwrapper

This is an improved and updated version of the outdated Github project Tempmail. Changes:

  • Completely up to date with the new Temp Mail API on RapidAPI.
  • Full Python3 support
  • Code improvements

Description

Python API wrapper for Temp Mail. Disposable email - is a free email service that allows to receive email at a temporary address that self-destructed after a certain time elapses. You can view full API specification in here or here.

Prerequisites

  • Python 3.X

Installation

$ pip install tempmailwrapper

Usage

Start by navigating to RapidAPI to obtain an API key. Create an account, fill in your details and subscribe to one of the plans. There's a free plan allowing for up to 100 request/day for free.

Once you have the API key, you can follow these examples:

Setting up a temporary email:

$ from tempmailwrapper import tempmailwrapper
$ tm = tempmailwrapper.TempMail(api_key="YOUR_API_KEY_HERE")
$ random_email_address = tm.get_email_address()
$ specific_email_address = tm.get_email_address(username='testing', domain='subcaro.com')

Get list of all emails for an email address:

$ from tempmailwrapper import tempmailwrapper
$ tm = tempmailwrapper.TempMail(api_key="YOUR_API_KEY_HERE")
$ email_address = tm.get_email_address()
$ print(random_email_address) # Now send an email here.
$ emails_list = tm.get_emails(email_address)

Get specific email:

$ from tempmailwrapper import tempmailwrapper
$ tm = tempmailwrapper.TempMail(api_key="YOUR_API_KEY_HERE")
$ email_address = tm.get_email_address()
$ print(email_address) # Now send an email here.
$ emails_list = tm.get_emails(email_address)
$ first_email_id = emails[0]['mail_id']
$ email = tm.get_one_message(first_email_id)
$ print(email.text) # Tip: use a library like BeautifulSoup to navigate your way easier through HTML-formatted emails.

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

tempmailwrapper-0.0.7.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file tempmailwrapper-0.0.7.tar.gz.

File metadata

  • Download URL: tempmailwrapper-0.0.7.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for tempmailwrapper-0.0.7.tar.gz
Algorithm Hash digest
SHA256 2932f0d3a054b96e3bb895e27ec91f65204e2f7158355c8437f2ea126acb7a2e
MD5 2789e047b72f466df55c32259d117e23
BLAKE2b-256 f2bf68feb9b2b1acc675949f4aeff3e67d3d1a720236111b953693311b15b5b0

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