> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Unipile: Send Email

> Sends a real email from the customer’s connected Gmail/Google, Microsoft/Outlook, or IMAP account. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Sends a real email from the customer’s connected Gmail/Google, Microsoft/Outlook, or IMAP account.

> [!NOTE]
>
> Tool ID: `unipile_send_email`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'unipile_send_email',
  {
    "account_id": "123456789",
    "to": [
      {
        "identifier": "example_123"
      }
    ],
    "body": "Example message"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute unipile_send_email --input '{
  "account_id": "123456789",
  "to": [
    {
      "identifier": "example_123"
    }
  ],
  "body": "Example message"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "object": "EmailSent",
    "tracking_id": "tracking_123",
    "provider_id": "provider_123",
    "provider_immutable_id": "provider_immutable_123"
  }
}
```

Use `deepline describe unipile_send_email --json` for the latest machine-readable contract.

## Input reference

⚠️ Interactive documentation does not work on this route (child parameters not correctly applied in snippet), please use our ready to copy past example of this page : [https://developer.unipile.com/docs/send-email](https://developer.unipile.com/docs/send-email)

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.account_id` | `string` | Yes | — | A unique identifier. Minimum length: 1. |
| `payload.from` | `object` | No | — | — |
| `payload.to` | `array` | Yes | — | — |
| `payload.cc` | `array` | No | — | — |
| `payload.bcc` | `array` | No | — | — |
| `payload.subject` | `string` | No | — | — |
| `payload.body` | `string` | Yes | — | — |
| `payload.reply_to` | `string` | No | — | Either the Unipile ID or the provider ID of the email to reply to. |
| `payload.custom_headers` | `array` | No | — | An array of custom headers to be added to the email. |
| `payload.tracking_options` | `object` | No | — | — |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "⚠️ Interactive documentation does not work on this route (child parameters not correctly applied in snippet), please use our ready to copy past example of this page : https://developer.unipile.com/docs/send-email",
    "properties": {
      "account_id": {
        "type": "string",
        "description": "A unique identifier.",
        "minLength": 1
      },
      "from": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "The name of the attendee."
          },
          "identifier": {
            "type": "string",
            "description": "The email address of the attendee.",
            "format": "emailLike"
          }
        },
        "additionalProperties": false
      },
      "to": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "display_name": {
              "type": "string",
              "description": "The name of the attendee."
            },
            "identifier": {
              "type": "string",
              "description": "The email address of the attendee.",
              "format": "emailLike"
            }
          },
          "required": [
            "identifier"
          ],
          "additionalProperties": false
        }
      },
      "cc": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "display_name": {
              "type": "string",
              "description": "The name of the attendee."
            },
            "identifier": {
              "type": "string",
              "description": "The email address of the attendee.",
              "format": "emailLike"
            }
          },
          "required": [
            "identifier"
          ],
          "additionalProperties": false
        }
      },
      "bcc": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "display_name": {
              "type": "string",
              "description": "The name of the attendee."
            },
            "identifier": {
              "type": "string",
              "description": "The email address of the attendee.",
              "format": "emailLike"
            }
          },
          "required": [
            "identifier"
          ],
          "additionalProperties": false
        }
      },
      "subject": {
        "type": "string"
      },
      "body": {
        "type": "string"
      },
      "reply_to": {
        "type": "string",
        "description": "Either the Unipile ID or the provider ID of the email to reply to."
      },
      "custom_headers": {
        "type": "array",
        "description": "An array of custom headers to be added to the email.",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The header name. Must start with 'X-' or 'x-' or be in this list: (List-Unsubscribe, List-Unsubscribe-Post, Reply-To, Content-Type)."
            },
            "value": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "value"
          ],
          "additionalProperties": false
        }
      },
      "tracking_options": {
        "type": "object",
        "properties": {
          "opens": {
            "type": "boolean"
          },
          "links": {
            "type": "boolean",
            "description": "You can disable link tracking for specific links by adding the attribute `'data-disable-tracking'` to the anchor tag."
          },
          "label": {
            "type": "string"
          },
          "custom_domain": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "required": [
      "account_id",
      "to",
      "body"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | @todo Email has been sent. |
| `result.data.object` | `"EmailSent"` | Yes | — | Allowed: `EmailSent`. |
| `result.data.tracking_id` | `string` | Yes | — | A unique identifier. Minimum length: 1. |
| `result.data.provider_id` | `string \| null` | Yes | — | — |
| `result.data.provider_immutable_id` | `string \| null` | Yes | — | `Outlook only`. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "@todo Email has been sent.",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "EmailSent"
            ]
          },
          "tracking_id": {
            "type": "string",
            "description": "A unique identifier.",
            "minLength": 1
          },
          "provider_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_immutable_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "`Outlook only`."
          }
        },
        "required": [
          "object",
          "tracking_id",
          "provider_id",
          "provider_immutable_id"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Unipile provider guide](https://deepline.com/docs/providers/unipile/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.