Fake SMTP Server for testing

When you develop a website or an application, you may need to use a fake SMTP server for debugging. Fake SMTP servers access emails, but they won’t deliver emails to the recipient’s email address.

The simplest way to run a debugging SMTP server is using the following python code

python3 -m smtpd -n -c DebuggingServer 0.0.0.0:2525

This will start an SMTP server on port 2525. It does not support SMTP authentication.

Advertisement

If you want to run a Fake SMTP server with Authentication support, use

https://github.com/rnwood/smtp4dev

You can install it using docker.

First you need to install Docker. On Ubuntu, run

apt install docker.io

Run smtp4dev with the command

docker run -d -it -p 3000:80 -p 2525:25 --restart=unless-stopped rnwood/smtp4dev

SMTP Server will listen on port 2525. On port 3000, you have a web interface to read the mails

Fake SMTP Server

See SMTP

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement