# Error: Invalid API key

Source: https://catalystgroup.gg/docs/email-delivery/error-invalid-api-key/
Updated: 2026-10-19 · By Duane Garner

The mail service did not recognise the API key CRM-NG SMTP sent. Copy a fresh key from the provider and paste it into the mailer settings.

> **Shown by API mailers (Mandrill, SMTP.com, Pepipost, Resend, SendLayer and others):** The test result or the error log shows `Invalid API key`, `API key invalid` or similar wording when CRM-NG SMTP sends through a service's web API.

 

This article is for site owners using any API key based mailer, such as **Mandrill**, **SMTP.com**, **Pepipost**, **Resend** or **SendLayer**, who see the key being rejected.

 

## What this error means

 

The service looked up the key that came with the request and found nothing that matches. To the provider, the key does not exist. The message is not about permissions or limits; it is the first check failing.

 

## Common causes

 
- A character was lost or added while copying, or a space or line break came along with the key.
- The key was revoked, deleted or regenerated in the provider's dashboard.
- The key belongs to a different product of the same company. For example, a Mailchimp marketing key does not work for **Mandrill**; Mandrill keys are created in the Mandrill app.
- A test-mode or sandbox key was used where a live key is required.
- The key was set in `wp-config.php` with a `CRMNG_SMTP_*` constant that still holds an old value.
- The site was restored from a backup or cloned, and the encrypted key could not be read with the current encryption key.

 

## How to fix

 
1. Open the provider's key page
  Mandrill: **Settings → SMTP & API Info**. SMTP.com: the API keys page in your account settings. Pepipost (Netcore): the integrations or API settings page. Resend: **API Keys**. SendLayer: **Settings → API Keys**.
2. Create a new key
  Make a new key for this site and copy it once, in full, without spaces.
3. Replace the stored key
  Go to **CRM-NG SMTP → Settings → General**, confirm the **Mailer** is the right service, press **Remove API Key**, and paste the new key into **API Key**. For SMTP.com also check **Sender Name** matches a sender in your account.
4. Save
  Wait for "Settings were successfully saved."
5. Send a test
  Go to **CRM-NG SMTP → Tools → Email Test**, fill in **Send To** and press **Send Email**.

 

## Verify it worked

 

The test page shows "Test email sent successfully! Check your inbox to confirm delivery." The provider's activity page lists the message.

 

## Notes

 
- If the **API Key** field is greyed out, change the constant in `wp-config.php`. See [secure settings with constants](https://catalystgroup.gg/docs/email-delivery/secure-settings-constants/).
- After moving a site, CRM-NG SMTP may not be able to decrypt secrets saved on the old site if the encryption key changed. Re-enter the key, or set `CRMNG_SMTP_CRYPTO_KEY` to the same value on both sites.
- SendGrid and Brevo have their own articles for their key errors. See the related links.
- Store keys only in CRM-NG SMTP or `wp-config.php`. Never send them by email or chat; see [sharing credentials safely](https://catalystgroup.gg/docs/email-delivery/sharing-credentials-safely/).

 

## Related

 
- [Mandrill mailer guide](https://catalystgroup.gg/docs/email-delivery/mailer-mandrill/)
- [SMTP.com mailer guide](https://catalystgroup.gg/docs/email-delivery/mailer-smtp-com/)
- [Pepipost mailer guide](https://catalystgroup.gg/docs/email-delivery/mailer-pepipost/)
- [Resend mailer guide](https://catalystgroup.gg/docs/email-delivery/mailer-resend/)
- [SendLayer mailer guide](https://catalystgroup.gg/docs/email-delivery/mailer-sendlayer/)
- [Error: Authorization grant invalid or expired (SendGrid)](https://catalystgroup.gg/docs/email-delivery/error-sendgrid-authorization-grant-invalid/)
- [Error: Unauthorized: key not found (Brevo)](https://catalystgroup.gg/docs/email-delivery/error-unauthorized-key-not-found/)
- [Troubleshooting email delivery](https://catalystgroup.gg/docs/email-delivery/troubleshooting/)
