Your site reached a mail server and tried to log in, and the login step failed. That is what “SMTP Error: Could not authenticate” means. Usually the server refused the user name and password; sometimes, as in one of our tests, the server offered no login at all and none was sent. Either way, no message went out, and the error does not say which happened.
When the server refuses a login, it sends a reply, such as 535 5.7.8 followed by a sentence, but WordPress throws that reply away and keeps only this generic line. In our tests, five different server replies, from a plain “credentials invalid” to Gmail asking for an app password to a server that offered no login at all, left WordPress with exactly the same 35 characters. If you have a 535 5.7.8 in front of you, it came from a debug log or a mailer plugin’s own output, not from the line WordPress records.
The error as WordPress records it
When wp_mail() fails, WordPress passes the mailer’s error message to the wp_mail_failed action, and that message is what an email log, a monitoring plugin or a form plugin’s notice shows you:
SMTP Error: Could not authenticate.
PHPMailer, the library WordPress bundles to send mail, raises this line with no detail attached. Every authentication failure we produced recorded it word for word, and the plugin screen that displayed the result showed “Failed” and this line, nothing more. A mailer plugin may reword the line or show its own debug output next to it; we did not test plugins. What reaches wp_mail_failed from PHPMailer never includes the reply.
What failed, and at which stage
An SMTP send happens in stages: the site connects, the server greets it, the two switch on encryption, the site logs in, and only then does the message go across. “Could not authenticate” is the login stage. The connection reached a server, so the blocked ports and certificate failures that stop a send earlier, with “Could not connect to SMTP host”, are not what happened here. The message alone does not prove the server is the one you meant to reach, or that every connection setting is right. Nothing after the login happened, so the mail server holds no message to look for.
Here is the login part of one of our test runs, with our test server answering in the wording a Postfix mail server uses. Postfix is widely used mail server software; we replayed its reply rather than running it.
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: [credentials hidden]
SERVER -> CLIENT: 334 UGFzc3dvcmQ6
CLIENT -> SERVER: [credentials hidden]
SERVER -> CLIENT: 535 5.7.8 Error: authentication failed: (reason unavailable)
SMTP ERROR: Password command failed: 535 5.7.8 Error: authentication failed: (reason unavailable)
SMTP Error: Could not authenticate.
The two 334 lines are the server asking for the user name and then the password; the strings after them are “Username:” and “Password:” in base64. Some servers repeat that string in their refusal, which is why a log can read authentication failed: UGFzc3dvcmQ6. It is the server’s prompt echoed back, not a clue.
What 535 5.7.8 means {#535-5-7-8}
535 5.7.8 is the standard SMTP reply for “authentication credentials invalid”, defined in
RFC 4954, section 6. It is not specific to Gmail: any server that follows the standard can send it. The words after the code vary by server:
| Server | Reply after the password |
|---|---|
| The standard (RFC 4954) | 535 5.7.8 Authentication credentials invalid |
| Postfix | 535 5.7.8 Error: authentication failed: <reason> |
| Gmail, as Google’s help page documents it | 535 5.7.80 Username and Password not accepted |
Postfix’s wording is from its source code (smtpd_sasl_glue.c, read 19 November 2026); when it has no reason to give, it writes (reason unavailable). Public reports quote Gmail’s reply as 535-5.7.8 Username and Password not accepted; it has its own section below.
One detail of the transcript misleads people. Our runs used the LOGIN method, and in them the server gave its verdict after the password, so PHPMailer reported Password command failed whichever half was wrong. The message does not mean your user name was accepted.
What public reports show
We read 9 public reports of this error: 8 WordPress.org support threads and one Stack Overflow question about PHPMailer outside WordPress, from January 2023 to November 2026, across Gmail, Microsoft 365 and hosting-company mail servers. Two ended with a reported fix, and they differ. On an Exim server that refused the login with 535 Incorrect authentication data, the reporter changed from TLS on port 587 to SSL on port 465 and sending resumed; the thread did not show which part of the change mattered. On a Titan mailbox sold through Hostinger, an answer on the Stack Overflow question reported that switching on the mailbox’s access for other apps in webmail fixed it. The other seven got advice, mostly “check the password” or “use an app password”, and no confirmed answer.
That is too few to rank causes, and we do not. Advice threads lean on the password; the two reported fixes were a connection setting and a mailbox switch. Read the server’s reply before you change anything.
How to tell which cause you have
You need the server’s reply, and it lives in the debug transcript: the line-by-line record of what the mailer and the server said to each other (the guide to reading an SMTP session log walks through one in full). Most SMTP plugins can write one; look for a debug log or an email log setting and send a test. Without a plugin, a short snippet does the same. Add it as a must-use plugin (a PHP file in wp-content/mu-plugins/), send one test, read your PHP error log, and remove the file:
<?php
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->SMTPDebug = 3; // connection-level detail
$phpmailer->Debugoutput = 'error_log'; // write to the PHP error log
}, 99 );
PHPMailer hides the credentials in the transcript, but it names your mail server and addresses, so do not paste it publicly unedited. An SMTP plugin that sets its own debug level may override this; its own log is the better source then. If the mailbox is on your own server, the mail server’s log holds the same refusal.
Match what you find:
| In the transcript | What it means |
|---|---|
535 5.7.8 after the password, any wording |
The server reports the credentials it was sent as invalid, the code’s meaning in RFC 4954 |
534 5.7.9 or 534 5.7.90, Application-specific password required |
Gmail asks for an app password |
No AUTH line in the server’s EHLO reply, and no AUTH command sent |
The server offered no login on this connection; there was nothing to authenticate against |
535 5.7.139 or 535 5.7.3 |
Microsoft 365, which has its own causes: see the Microsoft 365 page |
In our tests the first three all recorded the same “Could not authenticate” line; the Microsoft 365 report in our sample shows it too. The third row has no reply code at all; the only sign is a line missing from the server’s greeting.
The fix for each cause
The server refused the user name or password
Check the user name format and the SMTP credentials against the provider’s current setup instructions, and re-enter both fields in the plugin rather than editing them. If the mailbox password was changed recently, the plugin still holds the old one. A successful webmail login is a useful check that the password is current, but it does not by itself show that the mailbox may log in over SMTP.
Then look for a switch on the mailbox. Microsoft 365
documents an organisation-wide setting and a per-mailbox setting that turn SMTP logins off, and recommends leaving them off except for mailboxes that need them. Other providers may have similar controls; in the Titan report, the reported fix was switching on the mailbox’s access for other apps. Where the provider offers app passwords or SMTP-specific credentials, use those.
In the Exim report above, the reporter changed two settings together, port 587 with TLS to port 465 with SSL, and the login then worked. The thread did not show which change mattered, so check the port and encryption pair against the provider’s documentation as well.
Gmail: “Username and Password not accepted” {#gmail}
Google’s
Gmail SMTP errors and codes page (last updated 10 November 2026, read 19 November 2026) lists two replies for the login stage:
535 5.7.80 Username and Password not accepted
534 5.7.90 Application-specific password required
Public reports of this error quote the codes as 535-5.7.8 and 5.7.9, and that is the form we replayed in our tests; no test reached a Gmail server. The 534 reply says what Google wants: an app password. The 535 reply says only that the user name and password were not accepted; the code by itself does not identify the cause. Check Google’s account sign-in guidance and, on Google Workspace, your administrator’s policy. One cause Google does document: it
revokes every app password when the account password changes, so if a Gmail setup stopped working on a particular day, check first whether the account password changed that day.
The Gmail app passwords guide covers creating one, where it goes in the plugin, and the Workspace settings that block it.
The server offered no login
If the server’s EHLO reply lists no AUTH line, the site has nothing to log in to, PHPMailer sends no login command, and WordPress records the same error. In our test the transcript shows the server’s greeting, then the error, with no reply code. Some servers offer a login only after the connection is encrypted, so check whether your provider requires STARTTLS or SSL before login and that the plugin’s encryption setting and port match its documentation. Also check that the host name is the provider’s documented outgoing SMTP host.
Check that it stays fixed
After the change, send a test and confirm two things: the test reports success, and the message arrives. The delivery check guide covers the second part.
Logins break without anyone touching the site: a password is rotated, an app password is revoked, an administrator turns off SMTP for the organisation. A test sent on a schedule shows the failure without waiting for a customer to report it. nanoPost makes Email Check, a free plugin that sends a test on a schedule, keeps each result with its error text, and links a failure to nanoPost’s error decoder, which points to a page like this one. If you would rather not add a plugin, the wp_mail_failed hook guide shows how to log every failed send with a few lines of code.
How we tested
On 19 November 2026 we produced each failure on WordPress 7.1.5 with its bundled PHPMailer 7.1.1, on PHP 8.3.6 with OpenSSL 3.0.13. WordPress sent through a test SMTP server we control, over STARTTLS, configured through the phpmailer_init hook, and Email Check recorded the error that wp_mail_failed received. We set the server to refuse the login with the reply text from the standard, from Postfix’s source code and from Google’s documentation, to ask for an app password as Gmail does, and to offer no login at all; then we let it accept the login.
No test ran against Gmail, a Postfix server or any other provider: each provider’s reply was replayed from its documentation or source. The limits: one PHP version, core WordPress with no SMTP plugin in the path, and only the LOGIN method. The public reports come from searches of WordPress.org support and Stack Exchange made the same day.
If your log shows a different error, the WordPress email troubleshooting guide lists each one by stage. For SMTP reply codes in general, the SMTP field manual is the reference.
