# Send an email

> Send an HTML email with optional attachments from the platform's sending address.

Source: https://docs.generalinput.com/api/platform/send-email



<Endpoint method="POST" path="/v1/platform/send-email" />

<Access scope="platform:use" />

Emails go out from `mail@fromgeni.com`. The inbox is not monitored, so do not ask recipients to reply. HTML body only; there is no plain-text fallback.

## Body [#body]

| Field         | Type      | Required | Notes                          |
| ------------- | --------- | -------- | ------------------------------ |
| `to`          | string    | yes      | Recipient address.             |
| `subject`     | string    | yes      |                                |
| `htmlBody`    | string    | yes      | The body as HTML.              |
| `attachments` | object\[] | no       | See below. Each at most 10 MB. |

Each attachment:

| Field           | Type   | Required | Notes                         |
| --------------- | ------ | -------- | ----------------------------- |
| `filename`      | string | yes      | `report.pdf`                  |
| `contentType`   | string | yes      | MIME type, `application/pdf`. |
| `contentBase64` | string | yes      | The file, base64-encoded.     |

## Response [#response]

```json
{ "messageId": "a8c1…" }
```

The provider's message id, for tracking.

## Deliverability [#deliverability]

A recipient's first email from `mail@fromgeni.com` may land in spam. When you tell someone you emailed them, ask them to check spam and add the address to their contacts so later sends reach the inbox.

## Example [#example]

```sh
curl -s -X POST https://cloud.generalinput.com/v1/platform/send-email \
  -H "Authorization: Bearer $GI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"ada@example.com","subject":"Weekly report","htmlBody":"<p>Attached.</p>","attachments":[{"filename":"report.csv","contentType":"text/csv","contentBase64":"aWQsbmFtZQo="}]}'
```
