---
title: Send an email
---

[Skip to content](#_top)

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

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

Copy Markdown

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

---

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

# Send an email

email\_sending.send(EmailSendingSendParams\*\*kwargs) -> [EmailSendingSendResponse](<https://developers.cloudflare.com/api/python/resources/email_sending#(resource)%20email_sending%20%3E%20(model)%20email_sending_send_response%20%3E%20(schema)>)

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

account\_id: str

Identifier of the account.

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

body: [Body](<https://developers.cloudflare.com/api/python/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)>)

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

##### ReturnsExpand Collapse

<details>

<summary>

class EmailSendingSendResponse: …

</summary>

delivered: List\[str]

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: str

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: List\[str]

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: List\[str]

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: List\[str]

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

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
response = client.email_sending.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"],
    },
)
print(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
  }
}
```