> ## 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.

# Lemlist Email Account Operations: Inputs, Cost & CLI

> Connecting an SMTP/IMAP email account. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=lemlist_connect_email_account:{"sender_name":"{{sender_name}}","sender_email":"{{sender_email}}","smtp_host":"{{smtp_host}}","smtp_port":"{{smtp_port}}","smtp_login":"{{smtp_login}}","smtp_password":"{{smtp_password}}","imap_host":"{{imap_host}}","imap_port":"{{imap_port}}","imap_login":"{{imap_login}}","imap_password":"{{imap_password}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                    | Type      | Required | Default | Description                 |
| ----------------------- | --------- | -------- | ------- | --------------------------- |
| `payload.sender_name`   | `string`  | Yes      |         | Display name for the sender |
| `payload.sender_email`  | `string`  | Yes      |         | Sender email address        |
| `payload.smtp_host`     | `string`  | Yes      |         | SMTP server hostname        |
| `payload.smtp_port`     | `integer` | Yes      |         | SMTP port (e.g. 587, 465)   |
| `payload.smtp_login`    | `string`  | Yes      |         | SMTP login username         |
| `payload.smtp_password` | `string`  | Yes      |         | SMTP login password         |
| `payload.imap_host`     | `string`  | Yes      |         | IMAP server hostname        |
| `payload.imap_port`     | `integer` | Yes      |         | IMAP port (e.g. 993)        |
| `payload.imap_login`    | `string`  | Yes      |         | IMAP login username         |
| `payload.imap_password` | `string`  | Yes      |         | IMAP login password         |
| `payload.smtp_secure`   | `boolean` | No       |         | Use TLS for SMTP            |
| `payload.imap_secure`   | `boolean` | No       |         | Use TLS for IMAP            |
| `payload.user_id`       | `string`  | No       |         | Assign to specific user ID  |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Connect an SMTP/IMAP email account.",
    "properties": {
      "sender_name": {
        "type": "string",
        "description": "Display name for the sender",
        "minLength": 1
      },
      "sender_email": {
        "type": "string",
        "description": "Sender email address",
        "minLength": 1,
        "format": "email"
      },
      "smtp_host": {
        "type": "string",
        "description": "SMTP server hostname",
        "minLength": 1
      },
      "smtp_port": {
        "type": "integer",
        "description": "SMTP port (e.g. 587, 465)",
        "minimum": 1,
        "maximum": 65535
      },
      "smtp_login": {
        "type": "string",
        "description": "SMTP login username",
        "minLength": 1
      },
      "smtp_password": {
        "type": "string",
        "description": "SMTP login password",
        "minLength": 1
      },
      "imap_host": {
        "type": "string",
        "description": "IMAP server hostname",
        "minLength": 1
      },
      "imap_port": {
        "type": "integer",
        "description": "IMAP port (e.g. 993)",
        "minimum": 1,
        "maximum": 65535
      },
      "imap_login": {
        "type": "string",
        "description": "IMAP login username",
        "minLength": 1
      },
      "imap_password": {
        "type": "string",
        "description": "IMAP login password",
        "minLength": 1
      },
      "smtp_secure": {
        "type": "boolean",
        "description": "Use TLS for SMTP"
      },
      "imap_secure": {
        "type": "boolean",
        "description": "Use TLS for IMAP"
      },
      "user_id": {
        "type": "string",
        "description": "Assign to specific user ID"
      }
    },
    "required": [
      "sender_name",
      "sender_email",
      "smtp_host",
      "smtp_port",
      "smtp_login",
      "smtp_password",
      "imap_host",
      "imap_port",
      "imap_login",
      "imap_password"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name            | Type     | Required | Default | Description |
| --------------- | -------- | -------- | ------- | ----------- |
| `result.status` | `string` | Yes      |         |             |
| `result.result` | `object` | Yes      |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string"
      },
      "result": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "sender_name": {
            "type": "string"
          },
          "sender_email": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "smtp_status": {
            "type": "string"
          },
          "imap_status": {
            "type": "string"
          }
        },
        "required": [
          "_id",
          "sender_name",
          "sender_email",
          "status",
          "smtp_status",
          "imap_status"
        ],
        "additionalProperties": true
      }
    },
    "required": [
      "status",
      "result"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute lemlist_connect_email_account --payload '{
  "sender_name": "string",
  "sender_email": "string",
  "smtp_host": "string",
  "smtp_port": "integer",
  "smtp_login": "string",
  "smtp_password": "string",
  "imap_host": "string",
  "imap_port": "integer",
  "imap_login": "string",
  "imap_password": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ````md theme={null}
  > Connects a new SMTP/IMAP email account to your team.

  # Connect Email Account

  Connects a custom SMTP/IMAP email account that can be used as a sender in your campaigns.

  The account is validated against banned hosts and SSRF checks before being connected. Gmail SMTP/IMAP connections are not allowed — use OAuth instead.

  ## Examples

  &lt;CodeGroup>
    ```json minimal (required fields only) theme={"theme":"dracula"}
    {
      "sender_name": "John Doe",
      "sender_email": "john@company.com",
      "smtp_host": "smtp.company.com",
      "smtp_port": 587,
      "smtp_login": "john@company.com",
      "smtp_password": "password123",
      "imap_host": "imap.company.com",
      "imap_port": 993,
      "imap_login": "john@company.com",
      "imap_password": "password123"
    }
    ```

    ```json with secure flags and user assignment theme={"theme":"dracula"}
    {
      "sender_name": "John Doe",
      "sender_email": "john@company.com",
      "smtp_host": "smtp.company.com",
      "smtp_port": 465,
      "smtp_login": "john@company.com",
      "smtp_password": "password123",
      "smtp_secure": true,
      "imap_host": "imap.company.com",
      "imap_port": 993,
      "imap_login": "john@company.com",
      "imap_password": "password123",
      "imap_secure": true,
      "userId": "usr_A1B2C3D4E5F6G7H8I9"
    }
    ```
  &lt;/CodeGroup>

  &lt;Note>
    The `userId` parameter is optional. When provided, the email account is assigned to that specific team member (who must belong to the team). When omitted, it defaults to the API key creator or team owner.
  &lt;/Note>

  ## 26. Disconnect Email Account

  Source: https://developer.lemlist.com/api-reference/endpoints/email-accounts/disconnect-email-account.md
  ````
</details>

## Cost

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