Each provider is its own entry point, so you only bundle the one you import. Every provider
exposes the same send() and is_error() methods — swap providers without changing your
calling code.
Want another provider? Quit being a baby and open a PR.
Using a provider directly
Useful when you want an explicit instance, or you’re on a runtime without ambient env vars (e.g. Cloudflare Workers):
Every provider also accepts default, timeout, retries, retry_delay, auto_text,
and hooks on top of its own credentials — see Common constructor options.
Mock provider
postboi/mock records messages in-memory instead of sending them — same normalisation as a
real provider. Perfect for tests.
Custom headers & tags
headers and tags on send() are forwarded to each provider’s
native concept, and quietly ignored where unsupported:
- headers → Resend, Postmark, SendGrid, Mailgun (
h:), Brevo, SparkPost, Mandrill, Plunk, Mailtrap, Scaleway, Cloudflare. - tags → SendGrid (categories), Mailgun (
o:tag), Brevo, MailerSend, Mandrill, MailPace, Resend ({name,value}pairs). Postmark and Mailtrap use the first tag only.