Nodemailer SMTP Provider
This provider configures Nodemailer with SMTP settings from the environment, validates host/port/credentials with Zod, and exposes a lazy singleton getTransporter() for sending mail.
Features
- Zod schema for
SMTP_*andEMAIL_FROM - Single reused transporter instance
- TLS mode inferred from port (
securewhen port is 465) - MVC and Feature architecture variants
Installation Guide
npx servercn-cli add pr nodemailer-smtpFile Structure
MVC
-
src/configs/env.ts -
src/configs/nodemailer.ts
Feature
-
src/shared/configs/env.ts -
src/shared/configs/nodemailer.ts
Environment Configuration
src/configs/env.ts
Nodemailer transporter
src/configs/nodemailer.ts