---
title: sendTestMails
slug: campaign/docs/sendtestmails
docTags: 
createdAt: 2026-07-02T19:01:45.941Z
---

All mailing types and mailings in any status can be sent with this method.

:::hint{type="info"}
**Note**
The actual mail is sent asynchronously. That means that you should not delete any recipient immediately after calling this method.
:::

**Type**: int\[ ]

**Parameters**

| Name            | Type      | Value                                                                                                                   |
| --------------- | --------- | ----------------------------------------------------------------------------------------------------------------------- |
| sessionId       | String    | ID of the session                                                                                                       |
| mailingId       | long      | ID of the mailing                                                                                                       |
| recipientListId | long      | ID of the recipient list<br /><br />Must be a test recipient list and needs not to be configured for the given mailing. |
| recipientIds    | String\[] | IDs of the recipients<br /><br />Must match the target group and not be unsubscribed or blacklisted.                    |

**Return values**: For each recipient:

- 0: if the mail has been spooled
- 1: if the recipient is blocked
- 2: if the recipient is unsubscribed
- 3: if the recipient was not found
- 4: if the recipient list is invalid
- 5: if the recipient is blocked by the mailing's target group
- 6: if the recipient has caused too many bounces

**Code structure**

```java
int[] sendTestmails(String sessionId, long mailingId, long recipientListId, String[] recipientIds)
```
