---
title: addByMailId
slug: campaign-dev-docs/addbymailid
createdAt: 2026-07-02T19:01:46.338Z
---

The recipient is not removed from the recipient list (but will not receive any further mailings) until the [remove](https://docs.optimizely.com/campaign-dev-docs/remove-mailingwebservice) method is invoked or the recipient re-subscribes using a normal opt-in process.

In addition to the [add2](https://docs.optimizely.com/campaign-dev-docs/add2) method, the mailing the recipient received before she/he unsubscribed will be preserved. See also [MailIdWebservice](https://docs.optimizely.com/campaign-dev-docs/mailidwebservice).

**Type**: void

**Parameters**

| Name      | Type   | Value             |
| --------- | ------ | ----------------- |
| sessionId | String | ID of the session |
| mailId    | String | ID of the email   |

**Return values**

- **Code structure**

```javascript
void addByMailId(String sessionId, String mailId)
```
