Causes and Fixes for “smtp error: could not authenticate” error in phpmailer

I’m using PHPMailer in a Simple Script For Send Email’s Through Gmail, and I’m getting an “Unknown Error” (At least for me!):

SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate.

Solution to this problem

1) Google blocks insecure access

Gmail enforces strict security restrictions.

If an app doesn’t meet these security standards, it may block access because these apps are easier to break into.

Users who authenticate to Gmail server receive the error “smtp error: could not authenticate” because Google considers username and password login as insecure.

Solution

Ideally, we reconfigure the app so that it meets the Google standards. If this is not possible, we’ll help website owners to loosen the security restrictions using the below steps.

  • Sign in to the Google admin console.
  • Go to Security > Basic settings.
  • Go to Less Secure Apps.
  • Turn on Allow less secure apps.

phpmailer smtp error: could not authenticate

Allow less secure apps in gmail account

2) Expired Password

This can happen once in a while.

Some servers are set to auto expire passwords and app maintainers forget to update them in time.

When the application tries to connect, the mail server could not validate the password.

Result is “smtp error: could not authenticate” error.

Solution

This usually happens when the account owner missed the notification email about password expiry.

In such cases, we reset the password and also update it in the email application.

Read More

How to prevent emails go to spam folder in WordPress? How to use SMTP ?

1 thought on “Causes and Fixes for “smtp error: could not authenticate” error in phpmailer”

  1. Pingback: How to prevent emails go to spam folder in Wordpress? How to use SMTP ? - Jigopost

Leave a Reply