On this page
What this issue is
Many WordPress mail plugins (WP Mail SMTP, FluentSMTP, Post SMTP and similar) can send through your Google or Microsoft account using OAuth. Instead of storing a password, the plugin stores a long-lived refresh token that it swaps for short-lived access tokens each time it sends.
| Cause | Where it happens | Typical sign |
|---|---|---|
| Google Cloud app left in "Testing" status | Google Cloud Console, OAuth consent screen | Token dies after about 7 days |
| Password changed or sessions revoked | Google or Microsoft account | Works, then stops after an account security change |
| Access removed in account security settings | Google Account > Security > Third-party access; Microsoft My Account | invalid_grant |
| Token unused for a long time | Microsoft 365 (inactive refresh tokens lapse) | AADSTS700082 |
| Admin policy or conditional access change | Microsoft 365 admin / Entra ID | Sudden failures for everyone |
| Client secret expired | Azure app registration | Authentication fails at the set expiry date |
Why it costs you leads or sales
Day 0
Mailer connected to Gmail. Test email arrives.
Day 7
Token expires or is revoked. Sends start failing quietly.
Day 8
A visitor submits the form and sees a thank-you message. No email is sent.
Day 14
Someone notices the inbox has been quiet and checks the plugin log.
Day 14
Mailer reconnected. New leads arrive again, missed ones need recovering.
Example: 20 leads are submitted each week. With a valid token all 20 are emailed; with an expired token none are.
How to check if your site has it
Open the plugin's status or settings pageWordPress
In WP Mail SMTP, go to WP Mail SMTP > Settings and look for a notice that authorization is missing or expired. In FluentSMTP, check Settings > Connections.
Send the plugin's test emailWordPress
Use the Email Test tab (WP Mail SMTP) or the test option in your mailer. An authorization error here confirms the token problem.
Read the email log or debug eventsWordPress
Look for failures containing invalid_grant, AADSTS700082, 401 or "token expired or revoked". Email logging is off by default in some plugins, so enable it if you see nothing.
Check the account side
In Google, open your Google Account > Security > Your connections to third-party apps and services. In Microsoft 365, check My Account and the Entra ID app registration for the app and its secret expiry date.
Submit your own form
Fill in the live form with a test name and an email you control, then see if the notification arrives within a few minutes.
How to fix it
- Visitor submits formThank-you message shown
- Plugin asks Google/Microsoft to sendUses stored OAuth token
- Mail provider refusesinvalid_grant / 401
- Owner inboxNo notification
The form works, but the send step is refused, so the owner never hears about the lead.
Re-authorize the connection
In WP Mail SMTP, open Settings, choose your Gmail or Outlook mailer and click the button to remove and then re-connect the account, accepting the permissions. In FluentSMTP, edit the connection and click Authenticate again.
Fix the cause on the Google side
If you use your own Google Cloud project, open APIs & Services > OAuth consent screen and set Publishing status to In production. Apps in Testing status get refresh tokens that expire after about 7 days. Then re-authorize.
Fix the cause on the Microsoft side
In Microsoft Entra ID > App registrations, open your app, check Certificates & secrets for an expired client secret and create a new one. Paste it into the plugin and re-authorize.
Send the test email
Use the plugin's test tool, then submit the real form.
Rerun the OAuth consent flow
Generate a new refresh token for your app and store it where your mail library reads it. Make sure the app is published, not in test mode, and the client secret has not expired.
Handle failures loudly
Log send errors and alert on them rather than swallowing exceptions, so the next expiry is noticed in minutes.
Not applicable
Tag Manager does not send form emails. The fix is in your mailer plugin or server mail settings.
How to confirm it's fixed
- The plugin's test email arrives in the owner inbox
- A real submission on the live form arrives within a few minutes
- The email log shows the send as successful, with no invalid_grant or 401
- The email is not in spam and the Reply-To is the lead's address
- You have noted when the Google or Microsoft app secret or token will next need attention
Token expired
- Form shows success
- Plugin log shows invalid_grant or AADSTS700082
- Inbox stays empty
Token valid
- Test email arrives
- Log shows successful sends
- Every lead is emailed to the owner
How to prevent it happening again
- Publish your Google Cloud OAuth app (not Testing status)
- Put the Microsoft client secret expiry date in a shared calendar with a reminder a month ahead
- Use a dedicated sending account, not a person's mailbox, and keep it out of password-reset or security clean-ups
- Turn on email logging and failure alerts in your mailer plugin
- Keep form entries saved in the site or CRM as a backup
- Run a scheduled end-to-end test of the form so a silent failure is caught within a day
How FunnelGuard handles this
Expired
Leads or data lost
The form shows a thank-you message, but the mail provider refuses the send and no notification arrives.
The visitor sees the same success message either way. Only the inbox shows the difference.
Questions people ask
Why did my WordPress form emails stop after connecting Gmail?
The most likely reason is that the OAuth token your SMTP plugin uses was revoked or expired. A Google Cloud app left in Testing status is a common cause, as its tokens last about 7 days. Reconnect the account in the plugin and publish the app.
What does invalid_grant mean in WP Mail SMTP?
It means Google rejected the refresh token the plugin stored. The token expired, was revoked, or the account's security changed. Re-authorize the mailer in the plugin settings to get a new one.
How do I fix AADSTS700082 on Microsoft 365?
AADSTS700082 means the refresh token expired from inactivity. Reconnect the account in your mail plugin. Also check the Azure app registration for an expired client secret and replace it if needed.
How long does a Gmail OAuth token last for an SMTP plugin?
Normally it lasts until revoked, but if your Google Cloud app is in Testing status, the refresh token expires after about 7 days. Setting the consent screen to In production avoids that. Password changes or removed app access also end it.
Will I lose the leads sent while the token was expired?
The emails are not resent automatically. If your form plugin saves entries or sends leads to a CRM, you can find them there. If it does not, those leads may be gone, so turn on entry storage.
How can I know my form emails have stopped without checking every day?
Run a scheduled test submission that checks a test email arrives. FunnelGuard does this and alerts you when the email is missing, though it will not name the expired token as the cause. Your mailer's log shows the exact error.
Is it better to use OAuth or an SMTP password for form emails?
OAuth avoids storing a password, but depends on a token that can lapse. A dedicated transactional email service or site-specific SMTP account is often more stable, as long as SPF and DKIM are set up.
Related issues
- DLV-001Form submits but no notification email is sent to the businessFix guide
- DLV-010SMTP plugin (WP Mail SMTP, FluentSMTP) credentials expired or app password revokedFix guide
- DLV-009WordPress wp_mail uses PHP mail() and is silently discarded by the hostFix guide
- DLV-005Notification lands in the owner's Gmail/Outlook spam folderFix guide
- DLV-006Notification fails SPF because the site sends as the owner's domain from the web hostFix guide
- DLV-003Notification sent to an old or wrong recipient addressFix guide