Send a Test Email is a WordPress ability from GoSMTP – SMTP for WordPress — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Send a Test Email
WriteSend a live test email through the currently configured GoSMTP mailer and report whether delivery succeeded.
Requires the GoSMTP plugin on WordPress 6.9+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). Registration is also gated behind GoSMTP's own 'Enable AI Abilities' toggle (the ai_abilities.enabled option, switched on from the plugin's AI Abilities settings page) — with it off, none of the abilities are registered at all, regardless of WordPress version. All three abilities are additionally gated by the caller holding the 'manage_options' capability (administrator).
What it does
This ability sends a real email via wp_mail() using whatever SMTP mailer is currently configured in GoSMTP, to a recipient address supplied by the caller, with an optional custom subject and plain-text message body (both default to a generic GoSMTP test message if omitted). The recipient is sanitized and validated with is_email(); if it is missing or malformed, the ability returns a WP_Error instead of attempting delivery. If no mailer connection has been configured yet, it returns immediately with 'sent: false' and an explanatory error instead of attempting delivery. If wp_mail() reports failure, the ability inspects the global PHPMailer instance's ErrorInfo to surface the underlying SMTP error (e.g. authentication failure, connection refused) rather than a generic message. This is the ability an AI assistant calls in response to 'test my SMTP connection' or 'send a test email to confirm mail is working', giving an immediate pass/fail verdict with a concrete error to act on.
See it in action
You ask your AI assistant
"Send a test email to admin@example.com to confirm my SMTP connection is working."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | The recipient email address. |
| subject | string | No | The email subject line. Defaults to 'GoSMTP Test'. |
| message | string | No | The email body (plain text). Defaults to a generic GoSMTP test message. |
Returns
An object with 'sent' (boolean, whether wp_mail() reported success) and 'error' (string or null, an explanatory message when sending failed or no mailer is configured, otherwise null); or a WP_Error (invalid_recipient) when 'to' is missing or not a valid email address.
Permission
The current user must have the 'manage_options' capability (administrator).