---
title: Send an email
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Email Sending](https://developers.cloudflare.com/api/typescript/resources/email_sending)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Send an email

client.emailSending.send(EmailSendingSendParams {account\_id, body } params, RequestOptionsoptions?): [EmailSendingSendResponse](<https://developers.cloudflare.com/api/typescript/resources/email_sending#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)>) {delivered, message\_id, permanent\_bounces, 2 more }

POST/accounts/{account\_id}/email/sending/send

Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### ParametersExpand Collapse

<details>

<summary>

params: EmailSendingSendParams {account\_id, body }

</summary>

account\_id: string

Path param: Identifier of the account.

<a href="#(resource)%20email_sending%20%3E%20(method)%20send%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

body: <a href="https://developers.cloudflare.com/api/typescript/resources/email_sending/methods/send#(resource)%20email_sending%20%3E%20(method)%20send%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)">Body</a>

Body param

<a href="#(resource)%20email_sending%20%3E%20(method)%20send%20%3E%20(params)%20default%20%3E%20(param)%20body">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_sending%20%3E%20(method)%20send%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

EmailSendingSendResponse {delivered, message\_id, permanent\_bounces, 2 more }

</summary>

delivered: Array&lt;string&gt;

Email addresses to which the message was delivered immediately.

<a href="#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)%20%3E%20(property)%20delivered">Link to this property</a>

message\_id: string

Message ID of the sent email.

<a href="#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)%20%3E%20(property)%20message_id">Link to this property</a>

permanent\_bounces: Array&lt;string&gt;

Email addresses that permanently bounced.

<a href="#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)%20%3E%20(property)%20permanent_bounces">Link to this property</a>

queued: Array&lt;string&gt;

Email addresses for which delivery was queued for later.

<a href="#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)%20%3E%20(property)%20queued">Link to this property</a>

suppressed\_recipients: Array&lt;string&gt;

Email addresses dropped because they are on the suppression list. Returned when suppressed-recipient dropping is enabled for the sending subdomain; otherwise the request fails instead.

<a href="#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)%20%3E%20(property)%20suppressed_recipients">Link to this property</a>

</details>

[Link to this property](<#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)>)

### Send an email

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.emailSending.send({
  account_id: 'account_id',
  body: {
    attachments: [
      {
        content: 'JVBERi0xLjQK...',
        disposition: 'attachment',
        filename: 'report.pdf',
        type: 'application/pdf',
      },
    ],
    from: 'sender@example.com',
    html: '<h1>Hello</h1><p>Please find your report attached.</p>',
    subject: 'Monthly Report',
    text: 'Hello\n\nPlease find your report attached.',
    to: ['recipient@example.com'],
  },
});

console.log(response.message_id);
```

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "delivered": [
      "recipient@example.com"
    ],
    "message_id": "<aB3xK9mP2qR5sT8uV0wX1yZ4cD6fG7hJ9kL0@example.com>",
    "permanent_bounces": [
      "string"
    ],
    "queued": [
      "string"
    ],
    "suppressed_recipients": [
      "string"
    ]
  },
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "delivered": [
      "recipient@example.com"
    ],
    "message_id": "<aB3xK9mP2qR5sT8uV0wX1yZ4cD6fG7hJ9kL0@example.com>",
    "permanent_bounces": [
      "string"
    ],
    "queued": [
      "string"
    ],
    "suppressed_recipients": [
      "string"
    ]
  },
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0
  }
}
```