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

**Rotate the SMTP credentials.** Replace a sending domain's Mailgun SMTP credentials with new ones; the old ones stop working once the site uses the new ones. Three times an hour. Scope: write. Long-running: answers with a task.

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

## When to use it

Replace a sending domain's Mailgun SMTP credentials with new ones; the old ones stop working once the site uses the new ones. Three times an hour.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `sending_domain` (string, up to 253 characters): The default when omitted.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "sending_domain": {
      "description": "The default when omitted.",
      "maxLength": 253,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `unavailable`: email sending is set up on the production row only (staging and development rows send to a test inbox, Mailpit); use the production row. On a WordPress site whose platform plugins are turned off the message says only PHP mail is caught there (corestack_email_get's `mailpit.note`).
- `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_rotate_smtp",
  "arguments": {
    "site_id": 4211
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_email_rotate_smtp with site_id 4211. (Rotate the SMTP credentials.) Tell me what it returned.
```

## The same task elsewhere

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