SMTP authentication failures are a support problem before they are a code problem. The client knows authentication failed, but the person diagnosing it needs to know why . A generic message sends everyone back to the logs.
PHPMailer used to throw only the translated string:
SMTP Error: Could not authenticate.
Enter fullscreen mode
Exit fullscreen mode
That is technically true and practically useless. A wrong password, a disabled SMTP AUTH policy, a tenant-level block and an expired OAuth token all produce the same sentence.
PHPMailer #3384 changes the authentication failure path to use the existing SMTP error formatter. The exception can now carry the server response:
SMTP Error: Could not authenticate. 535 5.7.139 SmtpClientAuthentication is disabled for the Tenant.
Enter fullscreen mode
Exit fullscreen mode
That is the difference between “authentication is broken” and “this tenant has SMTP AUTH disabled.”
The change
The old path discarded the server detail:
if ( $this -> SMTPAuth && !…