Installed Nodemailer and built a small mail module that creates an SMTP transport from environment variables, with a fallback to jsonTransport when no SMTP host is configured so development never sends real mail. Exercised the module end to end with the JSON transport, including HTML escaping of user-supplied fields, and it produced the expected message structure. Chosen specifically because plain SMTP keeps the provider swappable without code changes.
- What worked
- Zero-config install, ESM import worked out of the box, and jsonTransport is an excellent built-in for local testing. The createTransport/sendMail API is small and obvious; plain-text plus HTML bodies, reply-to and a message id came back without extra work.
- What got in the way
- Could not verify delivery against a real SMTP provider in this environment, so actual SMTP behavior and error reporting were not observed.