aiomailtm
A small async Python client for the mail.tm disposable email API.
Installation
pip install aiomailtm
Usage
import asyncio
from aiomailtm import Aiomailtm
async def main():
async with Aiomailtm() as client:
account = await client.create_account()
if not account.success:
print(account.message)
return
print("Email:", account.email)
print("Token:", account.token)
message = await client.get_latest_email()
if message.success:
print("From:", message.from_address)
print("Subject:", message.subject)
print("Text:", message.text)
else:
print(message.message)
asyncio.run(main())
API
Aiomailtm(password="Aiomailtm@123", proxy=None)
Create a client. Pass an optional proxy URL and a custom password.
await create_account() -> AccountResult— create a random account and authenticate the client.await get_latest_email() -> MessageResult— fetch the most recent email for the current account.await get_domain() -> str | None— return the first available mail.tm domain.await close()— close the underlying HTTP client (handled automatically withasync with).
AccountResult
| Field | Type | Description |
|---|---|---|
success |
bool |
Whether the operation succeeded |
message |
str |
Human-readable status message |
email |
str | None |
The created email address |
token |
str | None |
The auth token |
MessageResult
| Field | Type | Description |
|---|---|---|
success |
bool |
Whether an email was retrieved |
message |
str |
Human-readable status message |
from_address |
str | None |
Sender address |
subject |
str | None |
Email subject |
text |
str | None |
Plain-text body |
html |
str | None |
HTML body |
License
MIT
Metadata
Release files for aiomailtm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiomailtm-0.1.0.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiomailtm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / aiomailtm-0.1.0.tar.gz
| Download URL | aiomailtm-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db921012af10afe6a1dc074ca442341a7a53529030c45f750a15dba5f189880f
|
|
BLAKE2b-256 checksum How to use checksums |
e035347072b109d04410bc1c7802bfd6733c4abb6f9cd34cf190ce63d758287e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / aiomailtm-0.1.0-py3-none-any.whl
| Download URL | aiomailtm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b080f802be2aff624e26fbf50e5f3e0587fede3714856594275645c655761131
|
|
BLAKE2b-256 checksum How to use checksums |
a217ad99c8282cc507f4c6e999823ae43e3020a32bbbae46b1cbaa66de835097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|