Skip to main content

python-tempmail10

Async temporary email client for 10minemail, built on curl_cffi with browser impersonation.

Create a disposable mailbox, then poll for incoming messages — useful for automated sign-up flows, OTP retrieval, and testing email delivery.

Features

  • Fully async API (asyncio).
  • Browser TLS impersonation via curl_cffi (Chrome).
  • Optional proxy support.
  • Async context manager for automatic session cleanup.
  • Typed result objects (AccountResult, EmailResult).
  • HTML emails parsed to plain text out of the box.

Requirements

Installation

pip install python-tempmail10

From source:

git clone https://github.com/yourname/python-tempmail10.git
cd python-tempmail10
pip install -e .

Quick start

import asyncio

from tempmail10 import Tempmail10


async def main():
    async with Tempmail10() as tempmail:
        account = await tempmail.create_account()
        print(account)
        if not account.success:
            return

        print("Your address:", account.email_address)

        # Block until an email arrives (or timeout).
        result = await tempmail.wait_for_message(timeout=120)
        if result.success:
            print("From:   ", result.sender)
            print("Subject:", result.subject)
            print("Text:   ", result.text)
        else:
            print("No email:", result.message)


if __name__ == "__main__":
    asyncio.run(main())

Usage

Creating a client

from tempmail10 import Tempmail10

# Default
tempmail = Tempmail10()

# With a proxy
tempmail = Tempmail10(proxy="http://user:pass@host:port")

Tempmail10 is an async context manager. Prefer async with so the underlying HTTP session is always closed:

async with Tempmail10() as tempmail:
    ...

If you manage the lifecycle manually, call await tempmail.close() when done.

Creating a mailbox

account = await tempmail.create_account()
# AccountResult(success=True, message='success create tempmail',
#               email_address='abc123@somedomain.com')

Fetching the latest message

result = await tempmail.get_latest_message()
if result.success:
    print(result.subject, result.sender)
elif result.empty:
    print("Mailbox is empty (no messages yet)")
else:
    print("Error:", result.message)

Waiting for a message

wait_for_message polls until a message arrives, a fatal error occurs, or the timeout is reached. Empty mailboxes are retried; fatal errors (auth/network) return immediately.

result = await tempmail.wait_for_message(timeout=120, poll_interval=3)

API reference

Tempmail10(proxy: Optional[str] = None)

Method Returns Description
await create_account() AccountResult Generate a new temporary email address.
await get_latest_message() EmailResult Fetch the most recent email in the mailbox.
await wait_for_message(timeout=120.0, poll_interval=3.0) EmailResult Poll until an email arrives or timeout.
await close() None Close the underlying HTTP session.

AccountResult

Field Type Description
success bool Whether the account was created.
message str Human-readable status message.
email_address Optional[str] The generated address (on success).

EmailResult

Field Type Description
success bool Whether an email was retrieved.
message str Human-readable status message.
sender Optional[str] Sender address.
subject Optional[str] Email subject.
html Optional[str] Raw HTML body.
text Optional[str] Plain-text body (parsed from HTML).
empty bool True when the mailbox has no messages yet.

Error handling

All client methods return result objects instead of raising on network/API failures. Inspect success (and empty for EmailResult) rather than wrapping calls in try/except:

result = await tempmail.get_latest_message()
if not result.success and not result.empty:
    # Genuine error (auth, network, server): message contains details.
    print(result.message)

Disclaimer

This library interacts with a third-party service that is not affiliated with this project. Use it responsibly and in accordance with the service's terms. Intended for testing and automation, not abuse.

License

MIT

Metadata

Release files for python-tempmail10 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-tempmail10 0.1.1
File Size Uploaded
python_tempmail10-0.1.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-tempmail10 0.1.1
File Interpreter ABI Platform
python_tempmail10-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / python_tempmail10-0.1.1.tar.gz

Download URL python_tempmail10-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ecf845146b87f6e00bbdc9f8330cef280e954f0bfeab50f69b002b8b21a4338
BLAKE2b-256 checksum
How to use checksums
36b97428601334a2c3481297c236df5ff382d08133dce1c1f46d8ccb654b5468
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / python_tempmail10-0.1.1-py3-none-any.whl

Download URL python_tempmail10-0.1.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
303d213fc4296c8961fa8e9d1a558589bbd7e10ef20a371bf8b07d08df74db5f
BLAKE2b-256 checksum
How to use checksums
6203a135dc49dbccdab4ae54cbe93cb0a32f3055b99cfbb269f92f0eb96b637e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page