Troubleshooting GMAIL SMTP authentication errors


Many websites use PHP to send email via SMTP. For example, you could create a custom mail form, or use a WordPress SMTP plugin. 

A problem you will run into is that Google's security settings do not allow you to send via SMTP through their servers unless you explicitly allow this. There are two ways to allow your application to send SMTP mail through GMAIL.

Enable the OAuth 2.0 protocol to authenticate connections

The first and most secure option is to enable OAuth 2.0 authentication for your application.

Please note that support is unable to assist with this custom configuration.

Enable 'Less secure apps' within GMAIL

Enabling 'Less secure apps' requires that you first disable 2-Step Verification on your Google account, and so is not recommended.

The second option is to enable 'Less secure apps' within GMAIL.

  1. Log into your GMAIL account.
  2. Navigate to the 'Less secure apps' page.
  3. Toggle to turn this feature 'ON'.
  4. Wait at least 1 hour for Google to update this setting.
  5. Test your mail application again. It should now send correctly via SMTP.

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?