DearByDear isn’t out yet. Join the waitlist for 50% off your first year when it launches.

DearByDear
GMAIL ERROR · PASSWORD NOT ACCEPTED

535 5.7.8: Username and Password not accepted

Gmail’s 535 5.7.8 error, “Username and Password not accepted,” means Gmail refused the password an app signed in with, so the app sent nothing. Most often the app was given your normal Google password, which Gmail no longer takes from other apps, or an app password that was mistyped or has since been revoked. Your list and your email aren’t the problem.

Returned mail
Gmail

535-5.7.8 Username and Password not accepted. For more information, go to 535 5.7.8 https://support.google.com/mail/?p=BadCredentials

Also seen as
  • Invalid login: 535-5.7.8 Username and Password not accepted.
  • [AUTHENTICATIONFAILED] Invalid credentials (Failure)
  • Username and password not accepted
Any app that signs in to Gmail to send or to read gets it before a single email goes; reading by IMAP shows the [AUTHENTICATIONFAILED] line.

Why it happens in a mail merge

A mail merge from Gmail goes out through an app, and the app has to sign in to Gmail first: by SMTP to send, and often by IMAP to read the replies. Google no longer lets other apps sign in with your Google password alone. The app needs an app password, a 16-character code Google makes for it, and Google offers one only once 2-Step Verification is on. Google’s steps, and why the option can be missing, are in how to make a Gmail app password.

It often appears in a merge that worked before. Google revokes every app password when you change your Google password, so the app is suddenly signing in with a code that no longer exists. A mistyped app password gets the same answer.

How to fix it

  1. Turn on 2-Step Verification

    In your Google Account, if it isn’t on yet. Google offers app passwords only on accounts that have it.

  2. Create an app password

    Open App passwords in your Google Account (myaccount.google.com/apppasswords), name it after the app, and create it. Google shows the 16-character code once.

  3. Use it in place of the password

    In the app’s account settings, replace the password with the new code and try again. If you changed your Google password since, the old app password is gone: make a new one.

  4. No App passwords option?

    Google names three reasons besides 2-Step Verification being off: 2-Step Verification set up only for security keys, a work, school or other organization’s account, and Advanced Protection.

What DearByDear does

DearByDear asks for the app password where you type it: “Paste the Gmail app password (16 letters, from myaccount.google.com/apppasswords). Not your normal Google password.” It takes the code with or without its spaces, and signs in with it to send and to read when you add the account. If Gmail refuses it then, or when you test the account later, DearByDear says what to do: “Gmail didn’t accept this password. Use an app password (steps above), not your normal password, and check that the address is right. No App passwords page? Turn on 2-Step Verification first; for a Google Workspace address, the administrator may have turned app passwords off.”

Send a test to myself, in Check and send, goes through Gmail for real, so a refused password shows there before a merge starts. If the password stops working partway through a Gmail mail merge, after a Google password change for example, the merge pauses with Gmail’s reply and nobody on the list is marked as failed. Make a new app password, change the Gmail account’s password under Accounts, then resume the merge where it stopped.

Questions about 535 5.7.8

Why does Gmail say “Username and Password not accepted” when my password is right?

Because the app was given your Google password, and Gmail no longer takes it from other apps: they need an app password. Google’s link in the error, ?p=BadCredentials, now opens its Account Recovery Guide, which doesn’t cover app passwords.

It worked before. Why do I get 535 5.7.8 now?

Most often because the Google password changed: Google revokes every app password when it does. On Google Workspace accounts, apps signing in with the Google password alone stopped working on March 14, 2025. Either way, the fix is a new app password.

Is “[AUTHENTICATIONFAILED] Invalid credentials” the same error?

Yes, from the reading side. Mail apps that read Gmail by IMAP show it for the same refusal, and Google lists both “Username and password not accepted” and “Invalid credentials” as errors you may see when a mail app can’t sign in. The fix is the same.

How do I fix 535 5.7.8 in Nodemailer or another script?

Sign in with an app password, not your Google password. Google recommends “Sign in with Google” where an app supports it; an app password is for the apps and scripts that don’t.

Sources

Each provider’s own pages, read on November 5, 2026. The error texts and the fixes are the providers’ own: if they change their wording, theirs is right.

  1. Google: Add Gmail to another email client
  2. Google: Sign in with app passwords
  3. Google: Transition from less secure apps to OAuth
  4. Google: Gmail SMTP errors and codes

Coming soon, with 50% off your first year.

Join the waitlistNot out yet · Windows & Mac · the waitlist hears first