MailFlatDocs
Documentation/Common test cases/Sending email

Testing your own inbound email handling

Point it the other way: send real mail from a MailFlat address and check that your application handles what arrives.

How it works

Every inbox can send as well as receive. Mail leaves from the inbox address through our own MTA, DKIM-signed, so your inbound pipeline — support ticket parsing, reply-to threading, bounce handling — is exercised by a genuine message rather than a fixture.

Send from the inbox

A plain text body is enough; add HTML when the thing under test cares about it.
inbox.send(
"support@your-app.com",
subject="Order #4182 never arrived",
body="Hi, my order has not shown up yet.",
)

Then assert on your side

The sent message is also kept in the inbox with direction set to out, so you can check delivery actually succeeded.
sent = [m for m in inbox.messages() if m.direction == "out"]
assert sent[0].send_status != "failed", sent[0].send_error

Worth knowing

Outbound counts against your quota
Sent messages use the same monthly allowance as received ones. A suite that sends on every run should say so in your capacity planning.