Mailhog

Mailhog SMTP server is a Web and API based SMTP testing tool which only runs in RAM and has not storage.

Getting Started

# In `perSystem.process-compose.<name>`
{
  services.mailhog."mh".enable = true;
}

Tips & Tricks

Send Emails

message="$(printf 'From: [email protected]\r\nTo: [email protected]\r\nSubject: Test email\r\n\r\nThis is a test message sent via curl to MailHog.\r\n')"

echo "Sending email."
curl -sS smtp://127.0.0.1:1025 \
        --mail-from "[email protected]" \
        --mail-rcpt "[email protected]" \
        --upload-file - <<< "$message"

Web UI

Inspect http://localhost:8025.

Using the API

curl http://127.0.0.1:8025/api/v2/messages | jq