v1.4.3These docs are for laramail v1.4.3. View changelog

Introduction & Overview

laramail is the AdonisJS mailer, but framework-agnostic — works with Express, Fastify, or any Node.js app.

The real differentiator: Mail.fake() + Mail.assertSent() for zero-setup email testing. No Mailtrap. No nodemailer mock setup. No grepping console output.

Mail.fake();
await Mail.to('user@example.com').send(new WelcomeEmail(user));
Mail.assertSent(WelcomeEmail, (mail) => mail.hasTo('user@example.com'));

Philosophy

  • Testing-firstMail.fake() is a first-class feature, not an afterthought. Test emails the same way you test everything else.
  • Framework-agnostic — Inspired by AdonisJS mailer and Laravel's Mail facade. Works with any Node.js framework.
  • Lightweight — Base package is ~25 MB (SMTP only). Install additional providers as needed.
  • Modular — Providers, template engines, queue drivers, and markdown support are all optional peer dependencies.
  • Type-safe — Full TypeScript support with strict typing throughout.

Feature Summary

FeatureDetails
TestingMail.fake() with Laravel-style send/queue assertions — zero setup
ProvidersSMTP, SendGrid, AWS SES, Mailgun, Resend, Postmark, Log Transport, Custom
Template EnginesHandlebars, EJS, Pug
QueueBull, BullMQ, Sync (dev)
Markdown MailWrite emails in Markdown with button, panel, and table components
Provider FailoverAutomatic failover chain with retries, delays, and monitoring callbacks
Rate LimitingPer-provider sliding window rate limiting
Email EventsHook into sending, sent, and failed lifecycle events

Requirements

  • Node.js >= 18
  • TypeScript 5.6+ (recommended)

Stats

  • 774 tests passing
  • 85%+ code coverage
  • MIT license