Skip to content

Simple smtp server for receiving test emails and a torque powered frontend for viewing them.

License

Notifications You must be signed in to change notification settings

tylermmorton/testmail

Repository files navigation

Build status

testmail

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.

Features

  • 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

Secondary Objectives

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!

Getting Started

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"

The Stack

This project was generated from the create-torque-app template and is using the following technologies:

  • torque - Webserver framework
  • htmx - Frontend framework
  • tmpl - Go html/template compiler and renderer
  • TailwindCSS - CSS framework
  • Docker - Container runtime
  • eslint - JavaScript & HTML linter
  • prettier - JavaScript & HTML formatter
  • Taskfile - Task runner & mini build system

About

Simple smtp server for receiving test emails and a torque powered frontend for viewing them.

Resources

License

Stars

Watchers

Forks

Packages