Open Source Email Testing

Test emails,
simplified

A lightweight email testing tool for developers. Catch and view test emails in a clean interface without sending to real inboxes.

Everything you need for email testing

Simple, powerful, and built for developers

Organized Projects

Separate emails by project. Keep test emails organized and easy to find.

Multiple Users

Create test users and send emails to different recipients. Perfect for testing user flows.

Clean Interface

View and manage all test emails in one place. Beautiful UI with dark mode support.

Get started in minutes

Three simple steps to start testing emails

1

Install MailStub

terminal
2

Start the server

terminal

Server starts on http://localhost:8000

3

Install the client & send test emails

terminal
app.ts
Best Practice

Switch between dev and production

Create an abstraction layer to easily switch between MailStub for development and real email services for production

lib/email.ts

Pro tip: This abstraction keeps your code clean and makes it easy to switch between testing and production environments. Your application code stays the same regardless of which email service you use.

Client API

Simple and intuitive API for sending test emails

client.send()

Parameters

  • projectIdThe ID of your project (format: p_xxxxx)
  • senderFull sender email address
  • receiverRecipient email (must be a user in your project)
  • subjectEmail subject line
  • bodyEmail body (supports HTML)

Example

Usage Guidelines

MailStub is designed for testing environments only

Use For

  • Local development
  • Staging & QA environments
  • CI/CD testing
  • Demo environments

Don't Use For

  • Production email delivery
  • Real customer emails
  • Sensitive or PII data
  • Compliance-regulated communications

Disclaimer: MailStub is designed exclusively for testing purposes. It does not send real emails or provide delivery guarantees, encryption, or compliance features. For production environments, use a proper transactional email service like SendGrid, Postmark, or AWS SES.