The mailing must be of the type regular.
See also [setMaxRecipientsPercentage](🔗).
**Type**: void
**Parameters**
Name | Type | Value |
sessionId | String | ID of the session |
mailingId | long | ID of the mailing |
maxRecipients | int | Maximum number of recipients<br><br>The value -1 means **All** (no maximum number of recipients set). |
randomOrder | boolean | <ul><li><span class="classLib">true</span>: Recipients are selected on a random basis.</li> |
<li><span class="classLib">false</span>: Recipients are selected by their ID starting with the lowest.</li></ul> | | |
**Return values**: -
**Code structure**