MailTime queues outbound mail for Node.js and Bun using nodemailer transports, with server processes that send and client processes that only enqueue. It supports multi-SMTP failover, retries, and MongoDB, Redis, or PostgreSQL storage.
Overview
MailTime extends nodemailer with a shared queue that multiple application instances can write to while one or more server instances deliver mail. Server mode claims rows with leases so clustered workers do not duplicate sends; client mode only enqueues, fitting a dedicated mail microservice topology.
Transports rotate by backup failover or round-robin balancing. Built-in retries, per-recipient partial failure handling, and optional concatenation of messages to the same recipient within a time window address operational email patterns. Presets tune behavior for transactional, OTP, newsletter, marketing, notification, and alert traffic.
Queue and scheduler storage can use the same database or split across stores documented in a compatibility matrix. The package ships ESM, CJS, and TypeScript types, runs on Node and Bun, and integrates optional AI agent skills for setup guidance. Graceful shutdown, pause, and resume help with deploys and SMTP rate limits.
Operators install via npm with peer dependencies for nodemailer and chosen queue drivers.
Key features
- Server and client deployment modes
- Multi-SMTP backup and balancer
- MongoDB, Redis, PostgreSQL queues
- Built-in retry and lease claims
- Email concatenation window
- Transactional and OTP presets
- Horizontal scaling across hosts
- Pause and resume on servers
Use cases
- Dedicated mail microservice in cluster
- OTP delivery with fast retries
- Newsletter batching and folding
- Failover across SMTP providers
- App servers enqueue only