Docs Error Library Authentication Errors Error 403: access_denied

Error 403: access_denied

What Is Causing This Error?

The ‘Error 403: access_denied’ issue often occurs when sending emails through the Gmail API. It indicates you’re trying to authorize a Google app that’s in testing mode in your SMTP plugin.

If the app you created on Google Cloud Console isn’t published or currently set to Testing, you’ll likely encounter this error.

Resolving the Error – Solution

To fix this error, you’ll need to publish your app from Google Cloud Console and reauthorize your SMTP plugin. We’ll explain the steps in this guide.

Publishing Your Google App

To publish your app, log in to the Google Cloud Console dashboard. Within your Google Cloud project, navigate to APIs & Services » OAuth consent screen.

APIs and Services section

In the OAuth consent screen page, click the MAKE EXTERNAL button.

Make app external

Next, select the In Production option in the overlay that appears. Then click CONFIRM to save your changes.

Set app publishing status to In Production

After updating your app status, you’ll need to reauthorize your Google app in the SMTP plugin you’re using.

Authorizing Your App

We’ll use WP Mail SMTP as an example for this guide. But the steps should be similar for other SMTP plugins.

To begin, log in to your WordPress admin area. Then go to WP Mail SMTP » Settings, and select the General tab.

WP Mail SMTP settings page

After that, scroll to the Authorization section and click the Remove OAuth Connection button.

Remove OAuth Connection

Once done, the button changes to Allow plugin to send emails using your Google account. Click on this button to authorize your Google account.

Allow plugin to send emails using your Google Account

On the next page, you’ll need to select the Google account linked to your app on Google Cloud.

Choose an account

Then click Continue to grant WP Mail SMTP access to your Google account.

Click Continue to Proceed

You’ll be redirected to your WordPress admin area. You should also see a success notice on the WP Mail SMTP settings page.

Success notice

Publishing your app and reauthorizing your SMTP plugin should resolve the ‘Error 403: access_denied’ issue.

Note: If you’d like to learn more about sending emails with WP Mail SMTP through the Gmail API, see WP Mail SMTP’s Gmail mailer guide.

That’s it! Now you know how to troubleshoot and fix the ‘Error 403: access_denied’ error.

Are you experiencing a different SMTP error, check out the following related tutorials: