---
title: setMaxRecipientsPercentage
slug: campaign/dev-docs/setmaxrecipientspercentage
createdAt: 2026-08-06T15:53:42.097Z
---

The actual number of recipients is calculated when the mailing is started. The mailing must be of the type regular. See also [setMaxRecipients](https://docs.optimizely.com/campaign/dev-docs/setmaxrecipients) and [getMaxRecipients](https://docs.optimizely.com/campaign/dev-docs/getmaxrecipients).

**Type**: void

**Parameters**

| Name          | Type    | Value                                                                                                                 |
| ------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| sessionId     | String  | ID of the session                                                                                                     |
| mailingId     | long    | ID of the mailing                                                                                                     |
| maxRecipients | Float   | Maximum number of recipients (float between 0 and 1)                                                                  |
| randomOrder   | Boolean | TRUE: Recipients are selected on a random basis; FALSE: Recipients are selected by their ID starting with the lowest. |

**Return values**

- **Code structure**

```javascript
void setMaxRecipientsPercentage(String sessionId, long mailingId, float maxRecipientsPercentage, boolean randomOrder)
```
