---
title: Send a raw MIME 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 a raw MIME email

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

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

Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).

##### 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_raw%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

from\_: str

Sender email address.

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

mime\_message: str

The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient’s email client displays.

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

recipients: Sequence\[str]

List of recipient email addresses.

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

##### ReturnsExpand Collapse

<details>

<summary>

class EmailSendingSendRawResponse: …

</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_raw_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_raw_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_raw_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_raw_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_raw_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_raw_response%20%3E%20(schema)>)

### Send a raw MIME 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_raw(
    account_id="account_id",
    from_="sender@example.com",
    mime_message="From: sender@example.com\r\nTo: recipient@example.com\r\nSubject: Hello\r\nContent-Type: text/plain\r\n\r\nHello, World!",
    recipients=["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
  }
}
```