---
title: "corestack_email_domain_add"
url: https://docs.corefinity.com/mcp/tools/corestack_email_domain_add
type: tool
last_updated: 2026-11-13
feature: email
related:
  - https://docs.corefinity.com/api/reference/site-settings/create-site-email-domain.md
  - https://docs.corefinity.com/guides/sites/site-settings/outbound-email.md
---
# corestack_email_domain_add

**Add a sending domain.** Add a sending domain on a Magento 2 production row for mail From another of its domains. That mail uses the default until it verifies (corestack_email_apply_dns, corestack_email_verify). Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Add a sending domain on a Magento 2 production row for mail From another of its domains. That mail uses the default until it verifies (corestack_email_apply_dns, corestack_email_verify).

On a row without the platform update for several sending domains (runtime v1-r14, applied in scheduled maintenance), the task fails at its key check with "This site needs a platform update before it can send from more than one domain…": nothing changes and mail keeps going through the default; retry it (corestack_operation_retry) after the update.

Each message goes out through the sending domain that matches the domain of its From address; everything else goes through the default. `store_mapping` in corestack_email_get shows which stores send From a domain without its own sending domain. A row holds up to five sending domains.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `from_domain` (string, up to 253 characters, required): One of the site's domains, or under one.
- `prefix` (string, up to 63 characters): Gives <prefix>.<from_domain>; mg by default.
- `adopt` (boolean): Staff only: adopt a domain already at Mailgun.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "adopt": {
      "description": "Staff only: adopt a domain already at Mailgun.",
      "type": "boolean"
    },
    "from_domain": {
      "description": "One of the site's domains, or under one.",
      "maxLength": 253,
      "type": "string"
    },
    "prefix": {
      "description": "Gives <prefix>.<from_domain>; mg by default.",
      "maxLength": 63,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "from_domain"
  ],
  "type": "object"
}
```

## Refusals

- `unavailable`: several sending domains are available on Magento 2 production rows only.
- `state`: set up the first sending domain (corestack_email_enable) before adding another.
- `limit`: the row already has five sending domains; remove one first.
- `duplicate`: the row already has a sending domain for that From domain, or another site uses that sending domain.
- `exists`: Mailgun already has that sending domain (usually on a previous host's account); remove it there, or use another prefix.
- `busy`: another change is running on the row; wait for it to finish.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_email_domain_add",
  "arguments": {
    "site_id": 4211,
    "from_domain": "example.org"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_email_domain_add with site_id 4211, from_domain example.org. (Add a sending domain.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/email/domains](https://docs.corefinity.com/api/reference/site-settings/create-site-email-domain.md)
- Guide: [Outbound email](https://docs.corefinity.com/guides/sites/site-settings/outbound-email.md)
