> For the complete documentation index, see [llms.txt](https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/email/send-email.md).

# Send Email

```json
// Body sample
{
    "name": "Welcome Email",
    "from":"John@email.com", 
    "fromName": "John from SmarthiveSMS",
    "to":["johndoe@email.com","chalesJames@email.com"], 
    "subject":"Welcome to Smarthive SMS", 
    "html":"Your HTML code",
    "ext_ref":"3823_juw"
}

```

{% hint style="info" %}

```
ext_ref is an optional field. The value must be unique
```

{% endhint %}

## Send

<mark style="color:green;">`POST`</mark> [https://api.smarthivesms.com](https://smsapi-sur2.onrender.com)`/api/email/campaign/send_campaign`

This endpoint allows you to send SMS Message

#### Headers

| Name                                        | Type   | Description  |
| ------------------------------------------- | ------ | ------------ |
| x-api-key<mark style="color:red;">\*</mark> | String | Your API Key |

#### Request Body

| Name                                       | Type                           | Description                                                                   |
| ------------------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>     | String                         | The name or label for the email campaign or template (used internally).       |
| from<mark style="color:red;">\*</mark>     | String                         | The sender's email address.                                                   |
| fromName<mark style="color:red;">\*</mark> | String                         | The name to display as the sender (e.g., brand or personal name).             |
| to<mark style="color:red;">\*</mark>       | `array[string]`                | A list of recipient email addresses.                                          |
| subject<mark style="color:red;">\*</mark>  | The subject line of the email. | The subject line of the email.                                                |
| html<mark style="color:red;">\*</mark>     | String                         | The HTML content of the email body.                                           |
| ext\_ref                                   | String                         | External reference ID for tracking the request (e.g., unique transaction ID). |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "status": "ok",
    "description": "Emails processed",
    "message": "Campaign started",
    "campaignId": "68489c7a62af22a517701da6"
}
```

{% endtab %}
{% endtabs %}
