The **Email to SMS** interface sends an SMS from an ordinary email, without writing a single line of code. The recipient number forms the address, the subject carries the credentials and parameters, and the body of the email is the message text.

> [!NOTE]
> The interface has to be activated in the Portal first. The steps and the credentials are described in the [API administration](https://www.bulkgate.com/en/docs/api-administration-tokens/api-administration/).

## Recipient address

The address the email is sent to:

```url
recipient_number@email2sms.bulkgate.com
```

The recipient number has to be written in the **international format**, with no leading zero and no `+` sign — for example `447971796595`.

## Subject format

The subject carries three mandatory and two optional parameters separated by a semicolon:

```text
wallet_id;email2sms_password;smstype;isms;sender
```

The optional parameters are dropped from the right — without them the subject is `wallet_id;email2sms_password;smstype`. The message text goes into the body of the email.

## Parameters table

| PARAMETER NAME     | VALUE                                                                                                       | MANDATORY | DEFAULT VALUE  |
|:-------------------|:--------------------------------------------------------------------------------------------------------------|:----------|:---------------|
| wallet_id          | Wallet ID from the Portal (`Modules & APIs` > `Email > SMS`)                                                | **Yes**   | -              |
| email2sms_password | Password from the Portal (`Modules & APIs` > `Email > SMS`)                                                 | **Yes**   | -              |
| smstype            | `1` — text shortened to 160 characters, `10` — EMS with text up to 612 characters                           | **Yes**   | -              |
| isms               | SMS gateway, value `0` – `4`. Mandatory for using a text sender ID.                                         | No        | `0`            |
| sender             | Sender of the message — a number in the international format (`447971796595`), or text of up to 11 characters (`eshop.com`) | No | System number |

> [!NOTE]
> You can find the `isms` value in the price list in the Portal — it is displayed when you hover over the wrench icon for developers.

> [!NOTE]
> Unicode SMS is not supported by this interface.

## Examples

### Example 1 — default gateway

An SMS of up to 160 characters to the number `+447971796595` with the text “Hi, how is it going?”, dispatched over the default gateway (system number).

**Recipient address:** `447971796595@email2sms.bulkgate.com`

**Subject:** `bg180012091617000;MadeUpPassword;1`

```text
wallet_id;email2sms_password;smstype
```

**Body of the email:** `Hi, how is it going?`

### Example 2 — text sender ID

The same SMS dispatched over gateway `2` with the text sender ID `eshop.com`.

**Recipient address:** `447971796595@email2sms.bulkgate.com`

**Subject:** `bg180012091249500;Password12345;1;2;eshop.com`

```text
wallet_id;email2sms_password;smstype;isms;sender
```

**Body of the email:** `Hi, how is it going?`

## Response

Emails are processed every minute. In case of an error, the server sends you back an email with the error number.
