MailFlatDocs
Email infrastructure for tests and agents

Documentation

Permanent email inboxes you can create from code. Read the one-time code your app just sent, run every CI job against its own real address, or hand an AI agent an inbox of its own.

pip install mailflat
 
import os
from mailflat import MailFlat
 
mf = MailFlat(api_key=os.environ["MAILFLAT_API_KEY"])
 
# 1. a real, deliverable address
# prefix = the local part of the address. label is a display name only.
inbox = mf.create(prefix="signup")
print(inbox.address) # signup@a7f2c.mailflat.net
 
# 2. your app sends the code to that address
my_app.register(email=inbox.address)
 
# 3. read it back, no mocking anywhere
otp = inbox.wait_for_otp(timeout=30)
print(otp) # "482913"
 
# 4. done with it
inbox.delete()

Runs against a real address. No mock server, no polling loop.

For AI agents

7 pages

Start here

Browse by tool

Everything else lives in the sidebar: common test cases, plans and retention, your own domain, the full API reference and the guides. Start with the quickstart if you are not sure where to begin.