Add new email connection is a WordPress ability from SureMail — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Add new email connection
WriteCreates and authenticates a new email-sending connection against its provider's credentials.
Requires the SureMail plugin installed on WordPress 6.9+ (for Abilities API support). Every ability also requires the current user to have the 'manage_options' capability. Abilities that create, modify, resend, or delete data are additionally gated behind separate site options: the destructive abilities (delete-connection, delete-email-logs) require the 'suremails_abilities_api_delete' option to be enabled, and the write abilities (add-connection, update-connection, send-test-email, resend-email, update-settings) require the 'suremails_abilities_api_edit' option to be enabled.
What it does
This ability creates a new SMTP or API-based email connection (e.g. SMTP, SendGrid, Mailgun, Postmark, AWS SES, SparkPost, Brevo, MailerSend, Mailjet, SMTP2GO, Elastic Email, Emailit, or Netcore) and validates the supplied credentials against the provider before saving. Gmail, Outlook, and Zoho are rejected because they require browser-based OAuth that cannot run through this ability. Provider-specific fields must use the exact key names the provider expects (for example AWS uses username/password for its Access Key ID/Secret Access Key, Postmark uses server_token). If no priority is given, the connection is appended as the lowest-priority entry, and if it is the first connection added it automatically becomes the site's default sender.
See it in action
You ask your AI assistant
"Add a new SendGrid connection using this API key, with the sender name 'Support Team' and from address support@example.com."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Provider type. Must be one of: SMTP, PHPMAIL, SENDGRID, MAILGUN, POSTMARK, AWS, SPARKPOST, BREVO, MAILERSEND, MAILJET, SMTP2GO, ELASTIC, EMAILIT, NETCORE. OAuth providers (GMAIL, OUTLOOK, ZOHO) are not supported here. |
| provider_settings | object | Yes | Provider-specific settings object containing common fields (connection_title, from_email required; from_name, force_from_email, force_from_name, priority optional) plus the exact provider-specific fields for the chosen type (e.g. api_key, host/port/encryption for SMTP, server_token/message_stream for Postmark, username/password/region for AWS). |
Returns
An object with success (boolean), a result message, and the newly created connection (id, type, from_email, from_name, connection_title, priority) with credentials stripped.
Permission
Requires the 'suremails_abilities_api_edit' site option to be enabled, and the current user must have the 'manage_options' capability.
More SureMail abilities
Delete connection
Permanently deletes an email connection by ID, an action that cannot be undone.
Delete email logs
Permanently deletes one or more email log entries and any attachments used only by them.
Get connection details
Retrieves the full non-sensitive details of a single email connection by its ID.
Get default connection
Returns the connection that WordPress is currently using to send all outgoing emails.
Get email delivery statistics
Returns aggregate sent/failed email counts and a daily breakdown for a given date range.
Get email log details
Retrieves the full stored details of a single logged email, including its body and provider response.