Skip to main content

Create and receive email in only 1 second! 📧 An API wrapper for www.1secmail.com written in Python.

Project description


1secMail

An API wrapper for www.1secmail.com written in Python.

About

This is a simple Python API wrapper for www.1secmail.com ↗ using the official 1secMail API. It allows you to easily generate temporary email addresses as much as you want and retrieve emails sent to those addresses.

Install

To install this package, you'll need Python 3.8 or above installed on your computer. From your command line:

pip install 1secMail

Note If you're willing to install the development version, do the following:

git clone https://github.com/qvco/1secMail-Python

cd 1secMail-Python

pip install -r requirements.txt

pip install -e .

How To Use

import secmail

client = secmail.Client()

client.random_email(amount=1)[0]
>>> 'vsd2bq6zo3@1secmail.net'

client.custom_email(username="bobby-bob", domain="kzccv.com")
>>> 'bobby-bob@kzccv.com'


# Checking your mailbox:
messages = client.get_messages("bobby-bob@kzccv.com")
for message in messages:
    print(message.id)
    print(message.from_address)
    print(message.subject)
    print(message.date)


# Fetching single message:
message = client.get_message(address="bobby-bob@kzccv.com", message_id=235200687)
print(message.id)
print(message.subject)
print(message.body)
print(message.text_body)
print(message.html_body)
print(message.attachments)
print(message.date)


# Checking attachment informations
for attachment in message.attachments:
    print(attachment.filename)
    print(attachment.content_type)
    print(attachment.size)

Licnese

This software is licensed under the MIT © Qvco.

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

1secMail-0.5.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

1secMail-0.5.0-py3-none-any.whl (6.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