# Send Email

**Action ID:** `send_email`

## Description

Send an email to specified recipients with customizable subject, body, and optional HTML content.

## Input Parameters

| Name              | Type   | Required | Default | Description                                                                           |
| ----------------- | ------ | :------: | ------- | ------------------------------------------------------------------------------------- |
| recipient\_emails | array  |     ✓    | -       | List email addresses of the recipients.                                               |
| cc\_emails        | array  |     -    | \[]     | List email addresses of the CC recipients.                                            |
| bcc\_emails       | array  |     -    | \[]     | List email addresses of the BCC recipients.                                           |
| subject           | string |     ✓    | -       | Subject of the email.                                                                 |
| body              | string |     -    | -       | Body of the email. This field is required if body\_html is not provided.              |
| body\_html        | string |     -    | -       | The body of the email in HTML format. This field is required if body is not provided. |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Input of the Send Email node.",
  "properties": {
    "recipient_emails": {
      "title": "Recipient Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the recipients."
    },
    "cc_emails": {
      "default": [],
      "title": "CC Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the CC recipients."
    },
    "bcc_emails": {
      "default": [],
      "title": "BCC Emails",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List email addresses of the BCC recipients."
    },
    "subject": {
      "title": "Subject",
      "type": "string",
      "description": "Subject of the email."
    },
    "body": {
      "default": null,
      "title": "Body",
      "type": "string",
      "description": "Body of the email. This field is required if body_html is not provided."
    },
    "body_html": {
      "default": null,
      "title": "Body html",
      "type": "string",
      "description": "The body of the email in HTML format. This field is required if body is not provided."
    }
  },
  "required": [
    "recipient_emails",
    "subject"
  ],
  "title": "SendEmailNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name      | Type   | Description                 |
| --------- | ------ | --------------------------- |
| message   | string | Status notification message |
| email\_id | string | The ID of the email sent    |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Output of the Send Email node.",
  "properties": {
    "message": {
      "title": "Message",
      "type": "string",
      "description": "Status notification message"
    },
    "email_id": {
      "title": "Email ID",
      "type": "string",
      "description": "The ID of the email sent."
    }
  },
  "required": [
    "message",
    "email_id"
  ],
  "title": "SendEmailNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node constructs an email message using the parameters you provide, then sends it through the email service. The email includes the specified recipients (To, CC, BCC), subject line, and body content (either plain text or HTML). The service returns a confirmation with the email ID and a status message indicating whether the send was successful.

## Usage Examples

### Example 1: Simple Text Email

**Input:**

```
recipient_emails: ["john@example.com"]
subject: "Welcome to AgenticFlow"
body: "Hi John, welcome to our service. We're excited to have you on board!"
```

**Output:**

```
message: "Email sent successfully"
email_id: "msg_1234567890"
```

### Example 2: HTML Email with Multiple Recipients

**Input:**

```
recipient_emails: ["user1@example.com", "user2@example.com"]
cc_emails: ["manager@example.com"]
subject: "Monthly Report - January 2024"
body_html: "<h1>Monthly Report</h1><p>Here is your monthly summary:</p><ul><li>Revenue: $10,000</li><li>Users: 500</li></ul>"
```

**Output:**

```
message: "Email sent successfully"
email_id: "msg_1234567891"
```

### Example 3: Email with BCC (Confidential Distribution)

**Input:**

```
recipient_emails: ["recipient@example.com"]
bcc_emails: ["admin@company.com", "archive@company.com"]
subject: "Account Confirmation"
body: "Your account has been successfully created. You can now log in."
```

**Output:**

```
message: "Email sent successfully"
email_id: "msg_1234567892"
```

## Common Use Cases

* **Notifications**: Send transactional emails like order confirmations, password resets, and account notifications
* **Marketing Campaigns**: Distribute marketing messages and newsletters to multiple recipients
* **Reports**: Send periodic reports, summaries, and data updates via email
* **Alerts**: Notify users of important events, errors, or threshold breaches
* **Confirmations**: Send confirmation emails for user actions like registration or form submissions
* **Multi-recipient Distribution**: Send the same message to groups of users with CC and BCC functionality

## Error Handling

| Error Type            | Cause                                      | Solution                                                        |
| --------------------- | ------------------------------------------ | --------------------------------------------------------------- |
| Invalid Email Address | Recipient email format is invalid          | Verify all email addresses follow the format: <user@domain.com> |
| Missing Subject       | Subject line is empty or not provided      | Provide a non-empty subject for the email                       |
| Empty Body            | Both body and body\_html are empty or null | Provide either plain text body or HTML body content             |
| Recipient List Empty  | recipient\_emails array is empty           | Add at least one recipient email address                        |
| Service Unavailable   | Email service is temporarily down          | Retry the operation after a delay or check service status       |
| Rate Limit            | Too many emails sent in a short period     | Implement delays between email sends or check rate limits       |

## Notes

* **Email Content**: You must provide either `body` (plain text) or `body_html` (HTML formatted). You cannot leave both empty.
* **Multiple Recipients**: Provide email addresses as an array. You can have multiple recipients, CC, and BCC recipients.
* **HTML Formatting**: Use `body_html` to create visually rich emails with formatting, images, and styling.
* **Email ID**: The output includes an email\_id that can be used for tracking or reference purposes.
* **Plain Text Fallback**: If providing HTML content, consider also providing plain text in `body` for email clients that don't support HTML.
* **Deliverability**: Ensure your sender domain is properly configured and authenticated to improve email deliverability.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/send_email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
