Skip to content

Mailpit

Mailpit catches messages from your test app and shows them in a local inbox for inspection.

Visit Mailpit

What would a local inbox prove?

Mailpit can receive messages from your app using SMTP, a protocol for sending email. Its web interface lets you open the captured message. Check the recipient, subject and content there. That proves capture in the test setup. A real inbox might handle the message differently.

What must you check before a test sends anything?

Confirm the app is disposable and its actual mail transport points only to a private local Mailpit instance. Check that forwarding is off and there is no SMTP relay configured for manual release or automatic sending. Disable any other path that could deliver mail. Use made-up records and addresses. If you cannot confirm all routes, stay with paper.

Keep the inbox private. Its usual SMTP setup has no authentication or encryption by default, so do not expose the test service to the internet.

Which mail evidence can you take with you?

Keep the template and its expected result in your project. Mailpit can export captured messages if you need to retain fictional evidence. A copy can contain addresses, message text or links, so handle it as carefully as the inbox.

Mailpit is MIT-licensed. You supply the machine or container and decide when to remove the test messages.

How would you check a confirmation without sending it?

Draw a fictional confirmation and local inbox. Do not start a mail service or send a message.

  1. Trace the intended route
    Draw the test app to the local inbox. Cross out forwarding, release and all live delivery paths.
  2. Write the expected message
    Mark the made-up recipient, class time and subject.
  3. Write the failure condition
    If the inbox were empty or the time differed, record the failure. Do not open links in this rehearsal. No capture or delivery was tested.