Skip to content

535 5.7.8 Username and Password Not Accepted: Fix It

What the 535 5.7.8 SMTP error means, why Gmail refuses your password even when it is right, and how app passwords, OAuth and the right settings fix it.

Nov 18, 2026 6 min read 1,296 words
535 5.7.8 Username and Password Not Accepted: Fix It
535 5.7.8 username and password not accepted
535 5.7.8 username and password not accepted

You set up a mailbox in your sending tool, your app or your printer. You click "Test". The answer comes back: "535 5.7.8 Username and Password not accepted". Nothing was sent.

The good news: this is not a bounce, and it does not hurt your sender reputation. It is a login problem. This guide explains what the error means, why it shows up even when your password is right, and how to fix it for Gmail, Google Workspace, Microsoft 365 and your own server.

What 535 5.7.8 means#

The error has two parts. 535 is the SMTP reply code for a failed login. 5.7.8 is the enhanced status code. The SMTP authentication standard, RFC 4954, defines the pair as "Authentication credentials invalid".

In plain words: your app tried to log in to the mail server before sending, and the server said no. The server never looked at your message. It did not get past the login step.

Gmail adds its own text and a help link. A typical reply looks like this:

  • 535-5.7.8 Username and Password not accepted. For more information, go to https://support.google.com/mail/?p=BadCredentials
  • 535 5.7.8 Error: authentication failed (common on Postfix and Dovecot servers)

Both mean the same thing. The credentials your app sent did not work for this server.

Why it is not a bounce#

A bounce happens after the server accepts your connection and looks at the recipient. A 535 happens before that, at login. So:

  • No message left your app.
  • No recipient saw anything.
  • Your bounce rate and sender reputation do not change.

That also means retries will not help. Until you fix the login, every send fails the same way. If you run campaigns, the sending tool will often pause the mailbox until you reconnect it.

Common causes of the error#

Most cases come from a short list. The first group is about the password itself.

  • You used your normal Google password. Google no longer lets most apps sign in over SMTP with just the account password. Apps need an app password or a sign-in with Google (OAuth).

  • 2-Step Verification is off. Google only offers app passwords on accounts with 2-Step Verification turned on.

  • The username is wrong. Most servers want the full email address as the username, not just the part before the @.

  • The password changed. You or your admin reset it, and the app still has the old one. Changing your Google password also revokes your app passwords.

  • A special character broke the password. Some apps and connection strings need characters like @, # or % to be escaped. If they are not, the server gets a different password. The second group is about the account and the server.

  • The account cannot use SMTP. An admin turned off SMTP sign-in, the mailbox has no license, or the account is suspended.

  • Too many failed tries. Some servers block the login for a while after repeated failures, even once the password is right.

How to fix 535 5.7.8 in Gmail and Google Workspace#

Most people who search for this code are sending through Gmail. Work through these steps in order.

Step 1: Check the username#

Use the full address, such as name@yourcompany.com. Check for typos and extra spaces.

Step 2: Turn on 2-Step Verification#

Open your Google Account, go to Security, and turn on 2-Step Verification. On a Workspace account, your admin may need to allow it first.

Step 3: Create an app password#

Google explains the steps in its guide to signing in with app passwords. You get a 16-character code. Paste it into your app as the SMTP password, without the spaces. Use one app password per app, so you can revoke one without breaking the others.

If the app password option is missing, your account may use a security key only, or your admin may have turned the option off.

Step 4: Use the right server settings#

For Gmail, the server is smtp.gmail.com. Use port 587 with STARTTLS or port 465 with SSL. Our guide to Gmail SMTP settings lists every field, and the Gmail SMTP port guide explains which port to pick.

Step 5: Prefer "Sign in with Google" when the app offers it#

Many sending tools can connect a Google mailbox with OAuth. You click a button, approve access, and there is no password to store. If your tool offers it, use it. It keeps working when you change your password.

How to fix it in Microsoft 365 and on your own server#

Microsoft 365 usually answers a failed SMTP login with a slightly different code, such as 535 5.7.3 Authentication unsuccessful. The fixes are close:

  1. Check that SMTP sign-in is allowed for the mailbox. Admins can turn it on or off per user in the Microsoft 365 admin center.
  2. Check the sign-in method. Microsoft is moving apps away from password-only SMTP sign-in. Use OAuth if your app supports it.
  3. Check the license. A mailbox without an active license cannot send.

On your own server (Postfix, Exim, Dovecot and similar), the error points at the login backend. Check the server logs at the time of the failure. Confirm the user exists, the password hash matches, and the auth service is running. After you fix it, run a quick SMTP test to confirm the login works.

How 535 5.7.8 compares with other SMTP errors#

Code What it usually means Was the email sent?
535 5.7.8 Login refused: wrong or blocked credentials No
535 5.7.3 Login refused (common Microsoft 365 wording) No
530 5.7.0 The server wants a secure connection or a login first No
550 5.1.1 The recipient mailbox does not exist No, it bounced
550 5.7.1 Refused by policy or reputation No, it bounced

The first three are setup problems on your side. The last two are bounces: the server took the connection and refused the recipient. For the full list, see our guide to email bounce codes.

A quick checklist#

  • Full email address as the username
  • 2-Step Verification on (Google)
  • App password or OAuth, not your account password
  • Right server, port and encryption
  • SMTP sign-in allowed for the mailbox
  • No old password saved in the app
  • One test send before you start the campaign

After the login works#

Once your mailbox connects, the next risk is the list itself. A clean login does not stop bounces from bad addresses. Run the list through an email verifier before the first send, so the mailbox you just fixed does not start its life with a high bounce rate.

FAQ#

What does 535 5.7.8 username and password not accepted mean?#

It means the mail server refused your login. The username or password your app sent was wrong, or the account is not allowed to sign in this way.

Is this error a bounce?#

No. The server rejected the login before it looked at any message. Nothing was sent, and your bounce rate does not change.

Why do I get it with the right password?#

Google and Microsoft often refuse password-only sign-in from apps. For Gmail, create an app password (it needs 2-Step Verification) or connect with "Sign in with Google".

Do I need a new app password after changing my Google password?#

Yes. Changing your Google password revokes your app passwords. Create a new one and update every app that used the old one.

Can a firewall cause this error?#

Not this one. A blocked port usually gives a timeout or a connection error. A 535 means the server answered and refused the login.

Ready to send? Check your list with the Tomba Email Verifier first, so your fixed mailbox only reaches real inboxes.

// start free

See who Tomba finds at any company

Type a company's domain to see its people, their roles and verified work emails, each with the pages it was found on. Free account, no card.

Free plan · No credit card required · GDPR & CCPA

Share
0 clapsEnjoyed it? Give a clap.
AU

// about the author

Tomba Editorial Team

Was this helpful?