Guides

Attachments

Attach bytes, strings, or runtime-supported file paths to email.

The one rule

Use content for portable attachments; path is available only on Node.js and Bun.
await mailer.send({
  from: "hello@example.com", to: "person@example.com", subject: "Invoice",
  attachments: [{ filename: "invoice.txt", content: "Paid" }],
});

Attachments can set contentType, encoding, contentId, inline, and MIME headers.