Quick Start with SMTP4DEV - Dummy SMTP Server for Development

Quick Start with SMTP4DEV - Dummy SMTP Server for Development

๐Ÿ“จ What is SMTP4DEV?

SMTP4DEV is a dummy SMTP server used for testing email functionality during development. It listens on the standard SMTP port, receives email messages, and stores them locally without forwarding them to the actual recipients.

This is particularly useful to prevent spamming real users during the development or testing phases.


๐Ÿ’ก Why Use SMTP4DEV?

During development, integrating an SMTP server is common for sending transactional or notification emails. Commercial SMTP providers like AWS SES, MailGun, or SendGrid are available, but using them early in the development cycle has drawbacks:

  • Risk of spamming real users
  • Difficulty in tracking and verifying email content
  • Dependency on network and credential setup
  • Cost implications

Some open-source applications (e.g., Ghost blog platform) require SMTP configuration. If a valid SMTP setup is unavailable, the application may not function properly. SMTP4DEV solves this by providing a local, dummy SMTP server for seamless testing.


๐Ÿณ Running SMTP4DEV in Docker

To run SMTP4DEV using Docker:

docker run --rm -it -p 80:80 -p 25:25 rnwood/smtp4dev
  • SMTP Port: 25
  • Web UI Port: 80

๐Ÿ“‹ Sample Logs

smtp4dev version 3.8.6
.NET Core runtime version: .NET 8.0.15
SMTP Server is listening on port 25
Web UI available at: http://[::]:80
Message received from username@exmple.com to suresh.sks.554@gmail.com
Processing received message DONE

๐Ÿ”Ž Accessing the Web UI

SMTP4DEV provides a built-in web interface for viewing received emails.

  • Open your browser
  • Navigate to: http://<your-ip-address>:80

You can browse received messages, inspect headers, and view content in the UI.

Alt Text


๐Ÿงช Testing with Applications (e.g., Ghost)

Configure any app that sends email to use your SMTP4DEV Docker instance. For example, Ghost CMS:

mail__transport: SMTP
mail__options__host: 172.20.0.4        # IP address of SMTP4DEV
mail__options__port: 25
mail__options__auth__user: username@exmple.com
mail__options__auth__pass: dummy-password
mail__from: username@exmple.com

Once configured, test emails from Ghost will appear in SMTP4DEV's web UI.


๐Ÿ“š References