How to test if an email was successfully send ?

About

When developing an email solution, you want:

  • to prevent that emails are going into the wild
  • to catch this email in order to assert that they were send with the good content.

There is several strategy that you can use.

Library

Local SMTP server

Simple SMTP server that accepts all messages and stores them. Your unit test code can then examine the messages (or lack thereof) and verify their validity.

docker run --name smtp -p 5025:5025 -p 5080:5080 -p 5081:5081 -d gessnerfl/fake-smtp-server

Filter

filter plugin





Discover More
What is a SMTP Server? The server that sends, receives, and processes email

What is an SMTP server and how to implement it



Share this page:
Follow us:
Task Runner