On this page
What this issue is
An API key is a secret string that proves your website is allowed to send email through your provider. Your site sends it with each request. If the key is deleted, expired, regenerated or limited to the wrong permissions, the provider answers with an authentication error, usually 401 Unauthorized or 403 Forbidden.
- Visitor submits formForm passes validation
- Site calls ESP APISends the old key
- ESP rejects key401 or 403 returned
- Email to inboxNever sent
- Sales follow-upNobody knows the lead exists
The visitor sees a normal thank-you page, but the provider refuses the send.
Why it costs you leads or sales
Day 0
Someone rotates the key in the ESP dashboard for security.
Day 0
The site still uses the old key. Every send returns 401.
Day 1-3
Form entries look normal in analytics, but the inbox is quiet.
Day 4
A customer asks where their confirmation is.
Day 4
The new key is added and emails resume. Earlier leads need recovering by hand.
Example: a site getting 10 form submissions a day. After the key is revoked, 0 notifications arrive until it is fixed.
How to check if your site has it
Submit a real test form
Use a fresh email address you can read, and note the time.
Check the ESP activity log
In SendGrid look at Activity, in Mailgun at Logs, in Postmark at the message stream Activity, in SES at CloudWatch or your sending metrics. No entry for your test means the request never got accepted.
Check the site or plugin error log
Look for 401, 403, 'Unauthorized', 'Forbidden', 'Invalid API key' or 'The security token included in the request is invalid'. In WordPress, your SMTP or mail logging plugin shows these.
Check the key in the ESP dashboard
Open the API keys page (SendGrid: Settings > API Keys; Mailgun: Sending > Domain settings > Sending API keys; Postmark: Servers > API Tokens; SES: IAM access keys). See whether the key the site uses still exists and has send permission.
curl -i --request POST https://api.sendgrid.com/v3/mail/send \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{"personalizations":[{"to":[{"email":"you@example.com"}]}],"from":{"email":"verified-sender@example.com"},"subject":"Key test","content":[{"type":"text/plain","value":"Test"}]}'How to fix it
Create a new key
In the ESP dashboard create a key with only the permission it needs (for SendGrid, Mail Send). Copy it immediately, as many providers show it once.
List every place that uses the old key
Check the website, any SMTP plugin, your CRM, checkout app, form tool, automation tools and staging sites.
Paste the new key
Update each place, using the platform instructions below.
Revoke the old key only after it is replaced
Once every system sends successfully, delete any leftover old keys.
Recover missed leads
Export form entries stored in your form plugin, CRM or database for the outage period and follow up manually.
Open your mail plugin
In plugins such as WP Mail SMTP, Post SMTP or the ESP's own plugin, open the settings and paste the new key or token. Save.
Check wp-config.php
Some setups define the key as a constant there. Update it in that file instead of the plugin screen if so.
Send a test
Use the plugin's Email Test tool, then submit a real form.
Find the integration
Shopify's own store emails do not use your ESP key. If a third-party email app (such as a marketing or order-notification app) uses your ESP, open that app's settings and reconnect or paste the new key.
Trigger a test order or form
Confirm the email arrives from the app.
Check server-side or webhook tags
GTM itself does not send email. If a custom HTML tag or server container calls your ESP, find the key in the tag or the server environment variables and replace it. Avoid keeping secret keys in client-side tags.
Update the connected service
Webflow form notifications do not use your ESP key. If you send through Zapier, Make or a custom endpoint, open that connection and paste the new key.
Resubmit a test form
Check the email arrives.
Open email sending settings
If you use your own SMTP or Mailgun connection, open Settings > Email Services, edit the provider and paste the new credentials.
Send a test email
Use the built-in test, then run a workflow that sends email.
Check Velo code and automations
Wix sends its own emails without your key. If you use Velo backend code or an automation that calls an ESP, update the key in Secrets Manager (Developer Tools) and redeploy.
Update the connected tool
Squarespace form emails do not use your ESP key. If a Zapier or similar connection sends through your ESP, reconnect it with the new key.
Update the secret
Change the key in your environment variables or secrets store (for example .env, hosting dashboard or a vault), not in source code.
Reload the app
Restart or redeploy so the process reads the new value, and clear any config cache.
Log send errors
Log the HTTP status and response body from the ESP so a 401 is never swallowed.
How to confirm it's fixed
- The ESP activity log shows your test message as accepted or delivered.
- A real form submission produces the team notification in the inbox.
- The customer auto-reply arrives, and is not in spam.
- Order or booking confirmations arrive if you use them.
- The error log shows no new 401 or 403 entries.
- The lead appears in your CRM if it is connected.
How to prevent it happening again
- Keep a short record of which systems use which key.
- Rotate keys on a schedule, and update the site in the same change.
- Create one key per system so you can revoke one without breaking others.
- Add the key to a shared secrets manager, not to personal notes.
- Log send failures and alert on 401 and 403 responses.
- Send a test lead after any security clean-up or staff offboarding.
Before
- One shared key used by many tools
- Key rotated in the ESP only
- Errors hidden behind a success page
After
- One key per system, documented
- Rotation and site update done together
- Send errors logged and alerted
How FunnelGuard handles this
Questions people ask
Why did my website emails suddenly stop sending?
A common cause is that the API key your site uses was revoked, deleted or rotated at the email provider. The provider then returns a 401 or 403 error for every send. Check the provider's activity log and your site's error log to confirm.
How do I update my SendGrid or Mailgun API key on my website?
Create a new key in the provider dashboard, then paste it where the site stores it: an SMTP plugin, an environment variable, or a connected app. Send a test and check the provider log shows it accepted.
Why does my form say success but no email arrives?
Many forms show the thank-you page before the email is sent, and do not check the provider's response. If the ESP rejects the key, the visitor still sees success while the email is never sent.
Does rotating an API key break my emails?
Yes, if the site keeps using the old key. Rotation invalidates the old value, so every system using it must be updated at the same time. Replace the key first, test, then revoke the old one.
What does a 401 or 403 from an email API mean?
A 401 usually means the key is missing, wrong or revoked. A 403 usually means the key is valid but lacks permission, or the sender is not allowed. Both stop the email from being sent.
How can I find which tool still uses the old key?
Search your site settings, plugins, environment variables, CRM and automation tools. The ESP activity log and key page can also show which key last made a request, depending on the provider.
Can FunnelGuard tell me my API key was revoked?
Not directly. FunnelGuard detects that expected test emails are missing and alerts you with a likely cause, but it does not read your ESP account. You confirm the key problem using the ESP logs.
How do I recover leads lost while emails were failing?
Export submissions saved in your form plugin, CRM or database for the outage dates and contact those people. If the form did not store entries, check analytics events or server logs for submissions.
Related issues
- DLV-064SendGrid/Mailgun/Postmark/SES account suspendedFix guide
- DLV-066ESP monthly sending quota exhaustedFix guide
- DLV-071Sender identity unverified in the ESPFix guide
- DLV-074Wrong ESP template ID after a template was deletedFix guide
- DLV-075Email sent from ESP test/sandbox mode, never deliveredFix guide
- DLV-067SES still in sandbox, only verified recipients get emailFix guide