Files
mailhog-demo/README.md
Benjamin Sigonneau 446fedc4a6 Add html email
2022-05-13 09:29:43 +02:00

1.3 KiB

A short app for showcasing Mailhog

How to send email?

  • use personal smtp (from FAI, gmail, work)
    • won't work because of the sender
    • I don't want to send with my personal account!
  • use a transactional email provider
    • eg. Mailchimp, Sendinblue
    • good for production
    • but do we really need this for dev or testing environments?
  • setup a full-blown smtp server
    • email is hard
    • who has time for this on a dev environment?
    • who has time for this on a test environment?
  • setup a quik'n'dirty fake smtp server
    • python -m smtpd -n -c DebuggingServer localhost:1025
    • better, but...
    • (show screenshot)
  • setup a proper fake smtp server

Other problems with sending mail

  • in dev/testing env, we don't really want to send to the actual recipients
    • but we still want to craft the email for them

Other benefits

  • can test email displays as wanted
  • can check attachments (receipt, invoice...)
  • API -> can be used in unit tests / CI
  • Test deliverability issues with Jim: MailHog's Chaos Monkey