---
title: sendMail
slug: campaign/docs/sendmail
docTags: 
createdAt: 2026-07-02T19:01:45.097Z
---

This method is only applicable to mailings of the type **event**.

:::hint{type="info"}
**Note**
If a target group is defined for the mailing, the mailing will be sent only if the recipient meets the target group criteria.
:::

The actual email is sent asynchronously. That means that you should not delete the recipients immediately after invoking 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 />This recipient list must be assigned to the given mailing. See also [getRecipientListIds](docId\:cRywr-vdpCnI6Au1pIWrL). |
| recipientId     | String | ID of the recipient                                                                                                                                          |

**Return values**

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

**Code structure**

```java
int sendMail(String sessionId, long mailingId, long recipientListId, String recipientId)
```
