How to Send Email from Bun: SMTP, APIs and bun test
Send email from Bun with Nodemailer over SMTP, a provider's HTTP API through fetch, or Email SDK with a fallback provider, then test it with bun test.
Blog
Notes for developers sending email from TypeScript: provider APIs, pricing, local testing, and switching providers without rewriting your send code. For the API itself, read the docs.
Send email from Bun with Nodemailer over SMTP, a provider's HTTP API through fetch, or Email SDK with a fallback provider, then test it with bun test.
Embed images in Node.js email with CID inline attachments: Nodemailer's cid field and example Resend, SendGrid, Postmark and Mailgun payloads.
Postmark alternatives in 2026: Resend, Mailgun, SendGrid, Amazon SES and Lettermint by price and message fields, plus a TypeScript switch with Postmark as the fallback.
MailerSend pricing, checked November 2026: Free, Hobby, Starter and Professional plans, overage per 1,000, the cheapest plan by volume, and how it compares.
Email API pricing compared, checked November 2026: Amazon SES, Resend, SendGrid, Mailgun and Postmark from 3,000 to 1 million emails a month, plus free tiers.
SendGrid pricing, checked November 2026: the 60-day trial, Essentials and Pro plans, overage per 1,000, the cheapest plan by volume, and SendGrid vs SES.
Mailgun pricing, checked November 2026: Free, Basic, Foundation and Scale plans, overage per 1,000, the cheapest plan by volume, and Mailgun vs Resend and SES.
Amazon SES pricing, checked November 2026: Essentials at $0.16 per 1,000, a la carte at $0.10, data and add-on fees, cost by volume, and SES vs Resend.
Send email from a Next.js server action: validate the form with zod, keep the API key server-only, stop duplicate sends, retry safely, and test without sending.
Test email in Node.js with Mailpit, the maintained MailHog replacement: Docker setup, Nodemailer and Email SDK, REST API checks in tests, and SMTP error tests.
Set up the Twilio SendGrid v3 API in Node.js: an API key, a fetch send in TypeScript, templates, scheduled sends, rate limit handling and signed webhooks.
Use the Brevo API from Node.js and TypeScript with fetch: the api-key header, templates, scheduling, batch sends, idempotency keys, rate limits, and webhooks.
Compare Resend alternatives by price, field support, and duplicate protection, then move to Amazon SES in TypeScript with Resend kept as the fallback.
Resend SMTP settings: host smtp.resend.com, user resend, API key as password, ports 465 or 587 (2465 or 2587 if blocked), with Nodemailer code and error fixes.
Resend pricing in 2026: the free tier's 3,000 emails a month (100 a day), Pro from $20, Scale from $90, overage, rate limits, and the cheapest plan by volume.
Send email from Node.js and TypeScript with SMTP and Nodemailer, a provider's HTTP API and fetch, or one client for any provider, and test it without sending.
Mailgun alternatives in 2026: Resend, Postmark, SendGrid, Amazon SES and Lettermint by price, log retention and fields, plus a TypeScript switch with fallback.
Use the Resend API from Node.js and TypeScript: fetch examples for sending and attachments, plus scheduling up to 30 days ahead, batches of 100 and webhooks.
Compare SendGrid alternatives by price, log retention, and field support, then switch providers in TypeScript with SendGrid kept as the fallback.
Use the Mailgun API from Node.js and TypeScript with fetch: API keys, US and EU base URLs, attachments, tags, errors, rate limits, retries, and webhook signatures.
Switching transactional email providers looks like an import change. Preserving behavior across failures and uncertain delivery is the difficult part.
It has been a busy week for Email SDK. Versions 0.6.2 through 0.6.5 shipped in rapid succession, bringing three brand-new provider adapters, a critical…