When developing an email solution, you want:
There is several strategy that you can use.
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