How to Solve Redirect_URI_Mismatch Error in FluentSMTP
Blog
Olivia Brown  

How to Solve Redirect_URI_Mismatch Error in FluentSMTP

If you’re using FluentSMTP to manage your WordPress site’s email delivery and encounter the dreaded Redirect_URI_Mismatch error, you’re not alone. This is one of the most common configuration issues when setting up FluentSMTP with external email services like Google or Microsoft Outlook. It can be frustrating—especially if you need your emails to work reliably in real-time for user registration, contact forms, or ecommerce notifications.

TL;DR

The Redirect_URI_Mismatch error in FluentSMTP occurs when the redirect URI configured in your third-party email provider (like Google or Microsoft) doesn’t match the one FluentSMTP is using. You can fix it by matching the redirect URI exactly in both FluentSMTP and the provider’s app settings. This usually means copying the URI from FluentSMTP settings into your OAuth application configuration. Always ensure any trailing slashes, HTTP/HTTPS settings, and domain names are identical between both platforms.

What is the Redirect_URI_Mismatch Error?

This error appears during OAuth authentication when you’re trying to authorize FluentSMTP to send emails through providers like Gmail or Outlook/Office365. It’s a security measure enforced by these providers, and it means that the URI (Uniform Resource Identifier) used during the request doesn’t match the one registered on their platform.

More specifically, the redirect URI is the endpoint that the service will use to send users back to your site after authorization. If this value is even slightly different between the FluentSMTP plugin and the app you’re setting up at Google or Microsoft, you’ll get the error.

Why This Error Happens

There are a few common reasons why you might encounter a Redirect_URI_Mismatch error:

  • Mismatched HTTP/HTTPS: If your WordPress site is served over HTTPS, but you’ve registered the URI with HTTP (or vice versa), that causes a mismatch.
  • Trailing Slash Error: A URI with a trailing slash (/) is not the same as one without it.
  • Wrong Domain or Subdomain: You might be using a staging or dev domain on your site, but have configured OAuth on the live domain.
  • Copy-Paste Issues: Sometimes, copying the URI from FluentSMTP gets an extra space or hidden character added.

In all these cases, the error is the same: the redirect URI doesn’t match exactly what the provider expects. Luckily, solving it is pretty straightforward.

How to Fix the Redirect_URI_Mismatch Error

Here’s a simple step-by-step guide to resolving the mismatch error, depending on whether you’re using Gmail (Google Workspace) or Microsoft Outlook (Office365).

Step 1: Locate the Correct Redirect URI in FluentSMTP

FluentSMTP provides the redirect URI within its plugin settings. To find it:

  1. Go to your WordPress dashboard.
  2. Navigate to FluentSMTP > Settings.
  3. Choose the mailer you’re using (i.e., Google or Microsoft).
  4. You will see a section called Redirect URI. Copy the entire URI exactly as shown.

This is the URI that the third-party service expects after the user completes authentication.

Step 2: Update Your OAuth App Settings

Depending on whether you’re using Google or Microsoft, the method of updating the redirect URI is different:

For Google Workspace (Gmail / Google API Console):

  1. Go to the Google API Console.
  2. Select your project or create a new one if necessary.
  3. Navigate to OAuth 2.0 Client IDs under Credentials.
  4. Edit the OAuth client connected to FluentSMTP.
  5. In the Authorized redirect URIs section, paste the URI you copied from FluentSMTP.
  6. Save your changes.

For Microsoft Outlook (Azure / Office 365 API):

  1. Go to the Azure Portal.
  2. Select Azure Active Directory > App Registrations.
  3. Click on the registered app connected to FluentSMTP.
  4. Choose Authentication.
  5. Under Redirect URIs, paste the URI from FluentSMTP.
  6. Save the configuration.

Once this is done, go back to FluentSMTP and complete the authentication process. The error should be resolved—assuming everything matches perfectly!

Best Practices to Avoid Redirect_URI_Mismatch in the Future

To ensure that this error doesn’t crop up again when updating, migrating, or backing up your site, follow these smart practices:

  • Always use HTTPS for both your site and the registered URI unless testing in a local environment.
  • Keep the URI updated in your third-party app dashboard if you ever change domains.
  • Double-check trailing slashes. “/callback” and “/callback/” are considered different URIs by most providers.
  • Store the redirect URI in a safe document or notes file. That way, if you reinstall or migrate the site, reconfiguration is easier.

What to Do If the Error Persists

If you’ve followed all the steps above and you’re still seeing the Redirect_URI_Mismatch error, try these extra tips:

  • Clear your browser cache and cookies. Sometimes cached authentication attempts can interfere.
  • Try incognito mode or a different browser to verify the problem isn’t browser-specific.
  • Recreate the OAuth App: As a last resort, delete the current app integration from your provider’s dashboard and start fresh with a new one and new credentials.

Also, check for any plugin conflicts or firewall settings that may be interfering with FluentSMTP’s ability to complete the handshake.

Bonus: Multi-Site and Staging Caveats

Many developers test FluentSMTP in staging or local environments before pushing to live. But keep in mind:

  • Each environment (staging, local, production) has its own Redirect URI.
  • If you use different domains or subdomains, you’ll need to register those separately with Google or Microsoft.
  • You can’t use a localhost redirect URI with Google OAuth when using production credentials—Google disallows this for security reasons.

Wrapping Up

The Redirect_URI_Mismatch might be a small configuration hiccup, but it can halt your email functionality if not fixed. FluentSMTP makes it easy by providing everything you need in its settings—you just need to ensure it matches exactly with your provider’s app configuration. And remember, every character—including trailing slashes or variations in HTTP vs HTTPS—counts.

By understanding how OAuth and FluentSMTP interact, you can solve this issue quickly and prevent it from coming back in the future. Keep a copy of your working Redirect URI settings, and always double-check when making changes to your domain or site configuration.