testmail
is a drop-in replacement for your production SMTP server that you can run in your local development environment. It catches all emails sent by your application and allows you to inspect them in a web interface. This is useful for testing end-to-end flows that involve sending and opening emails. To that end, testmail also provides crawler interfaces for go-rod and Cypress to help you implement automated email tests quickly.
Why? Sending test emails from your domain to a real inbox may affect your deliverability and cause your emails to be marked as spam. This is especially true if you are sending a large volume of emails during development and testing. Using a local SMTP server allows you to test your email flows without affecting your production email reputation.
- SMTP server that catches all emails and stores them in an embedded mongodb collection
- Web interface for viewing and managing emails received by testmail
- Docker image for easy deployment and integration into your testing stack
- go-rod & cypress integrations for driving automated testing
testmail
is not only a useful development tool, but also an experiment in building a hypermedia-based web application in Go using the torque framework. This project is meant to dogfood the framework and provide examples of how to build interactive pages when using torque with htmx.
👋🏻 The project is open to contributions and feedback, so feel free to open an issue or PR if you have any ideas or suggestions!
The easiest way of getting started with testmail
is to use the Docker image. You can run the image with the following command:
docker run -p 8080:8080 -p 1025:1025 ghcr.io/tylermmorton/testmail:main
This will start the SMTP server on port 1025
and the web interface on port 8080
. You can then configure your application to send emails to localhost:1025
and view them in the web interface at localhost:8080
.
You can also use docker-compose
to integrate testmail
:
testmail:
container_name: testmail
image: ghcr.io/tylermmorton/testmail:main
ports:
- "8080:8080"
- "2500:2500"
This project was generated from the create-torque-app
template and is using the following technologies: