> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Sending

> Send up to 100 emails in one go. Great for receipts, notifications, and anything personalized but high volume.

# Batch Sending 📬📬📬

Need to send 50 different receipts? Or 100 personalized shipping updates? Instead of making 100 API calls, you make just **one**. That's batch sending.

You send an array of emails, Mailofly processes them all at once, and each recipient gets their own unique, personalized email. Much faster. Much simpler.

***

## The endpoint

```http theme={null}
POST https://api.mailofly.com/emails/batch
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

***

## Code example

```typescript theme={null}
import { Mailofly } from "@mailofly/node";

const mailofly = new Mailofly("mfly_live_your_api_key");

const { data, error } = await mailofly.batch.send([
  {
    from: "Acme <receipts@acme.com>",
    to: ["alice@example.com"],
    subject: "Your Invoice #1001",
    html: "<p>Hi Alice! Your total was $49.00. Thanks a bunch! 🎉</p>",
  },
  {
    from: "Acme <receipts@acme.com>",
    to: ["bob@example.com"],
    subject: "Your Invoice #1002",
    html: "<p>Hi Bob! Your total was $99.00. You're awesome! 🙌</p>",
  },
  {
    from: "Acme <receipts@acme.com>",
    to: ["charlie@example.com"],
    subject: "Your Invoice #1003",
    html: "<p>Hi Charlie! Your total was $149.00. Big spender! 💰</p>",
  }
]);

if (data) {
  console.log("All sent! IDs:", data.map(item => item.id));
}
```

Each email in the batch gets its own ID, its own tracking, and its own log entry — they're treated completely separately, just bundled together for efficiency.

***

## Good to know

* 📦 **Max 100 emails** per batch request
* 📏 **Max 10MB** total payload (all emails combined, including attachments)
* Every email gets its own delivery log and tracking ID
* If one fails, the others still go out — it's not all-or-nothing


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.