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

# Multiple recipients

> Send email to multiple recipients with the to array, learn how addresses are serialized, and when to send individual emails for privacy.

The `to` parameter of `sendEmail` accepts either a single string or an array of strings. When you pass an array, every recipient sees the full To list. This is appropriate for team notifications, shared updates, and other messages where recipients know each other.

## Passing multiple recipients

```typescript theme={null}
const result = await client.sendEmail(
  ["alice@example.com", "bob@example.com", "charlie@example.com"],
  "Team standup notes",
  { text: "Notes from today's standup are attached." }
);
```

## How arrays are serialized

The SDK joins array values differently depending on whether the request uses JSON or multipart:

| Transport | Join separator | Example |
| - | - | - |
| JSON (no attachments) | `,` (comma, no space) | `"alice@example.com,bob@example.com"` |
| Multipart (with attachments) | `, ` (comma + space) | `"alice@example.com, bob@example.com"` |

Single string values are passed as-is in both cases. The API handles the final delivery.

## Validation

The SDK validates `to` before sending:

* It must be a non-empty string after trimming, or a non-empty array.
* Every array element must be a non-empty string after trimming.

If validation fails, the method returns `{ success: false, errorMessage: "'to' must contain at least one recipient" }` with no `statusCode`.

> [!NOTE]
>
> The SDK does not validate email address format. The API validates addresses and enforces recipient limits server-side. The exact maximum number of recipients per message is not published by BosonWare. Contact [support@bosonware.com](mailto:support@bosonware.com) to confirm your plan's limits.

## When to send individual emails instead

If recipients should not see each other's addresses, or if you need per-recipient customization, loop over the list and call `sendEmail` once per recipient. This also gives you per-recipient `Result` objects and `messageId` values for tracking.

```typescript send-individual.ts theme={null}
import BosonMailClient from "@bosonware-ent/bosonmail";

const client = new BosonMailClient({ apiKey: process.env.BOSONMAIL_API_KEY! });

const recipients = ["alice@example.com", "bob@example.com", "charlie@example.com"];

for (const recipient of recipients) {
  const result = await client.sendEmail(
    recipient,
    "Your personalized report",
    { text: `Hi, here is your report for this week.` }
  );

  if (result.success) {
    console.log(`Sent to ${recipient}: messageId=${result.messageId}`);
  } else {
    console.error(`Failed to ${recipient}:`, result.errorMessage);
  }
}
```

> [!TIP]
>
> Individual sends give you per-recipient status tracking via `messageId`, but each message counts against your plan's outbound allowance. Confirm with BosonWare whether API sends through the SDK count toward your inbox's 500 outbound emails per month.

## CC and BCC with multiple recipients

You can combine multiple `to` recipients with `cc` and `bcc`. See [CC and BCC](https://docs.bosonware.com/sdk/cc-and-bcc.md) for full details on how each field behaves and how arrays are serialized.

```typescript theme={null}
const result = await client.sendEmail(
  ["team-a@example.com", "team-b@example.com"],
  "Project update",
  {
    text: "The project is on track.",
    cc: "manager@example.com",
    bcc: ["archive@example.com", "audit@example.com"]
  }
);
```

> [card] [CC and BCC](https://docs.bosonware.com/sdk/cc-and-bcc.md)
>
> How CC and BCC fields work with single and multiple recipients.

> [card] [Sending emails](https://docs.bosonware.com/sdk/sending-emails.md)
>
> Full sendEmail reference with all parameters and validation rules.

> [card] [Email status](https://docs.bosonware.com/sdk/email-status.md)
>
> Track delivery for each messageId after sending.

> [card] [Guides: Multiple recipients](https://docs.bosonware.com/guides/multiple-recipients.md)
>
> Practical guide for batch and individual sending patterns.


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