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
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, open the navigation menu and go to APIs & Services » OAuth consent screen.

Open Audience to find your app’s publishing status.

Once there, click the Make External button to publish your app.

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

After updating your app status, you’ll need to reauthorize your Google app in the SMTP plugin you’re using.
Note: If you’re using a free Gmail account, you won’t see the Make external button. Instead, you’ll see Publish app under the app’s publishing status.
Authorizing Your App
We’ll use WP Mail SMTP as an example for this guide. The steps are 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.

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

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

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

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

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

Publishing your app and reauthorizing your SMTP plugin resolves 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: