Gmail 535 5.7.8: username and password not accepted

535 5.7.8Username and password not acceptedPermanent: retrying will not helpFrom Gmail and Google Workspace

Example
535-5.7.8 Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials - gsmtp

What it means

This error comes from Google’s submission service at smtp.gmail.com, not from an inbound Gmail server. Your device or application tried to log in with SMTP AUTH and Google refused the credentials. RFC 4954 defines 535 5.7.8 as “authentication credentials invalid”.

Very often the password is correct. Google no longer allows plain account passwords for SMTP from third-party apps; it expects OAuth or an app password generated after 2-Step Verification is enabled. That is why printers, scanners, and old scripts suddenly break with this message.

Likely causes

  • Using the normal Google password in an app that does not support Sign in with Google (OAuth).
  • An app password that was revoked, mistyped, or generated for a different account.
  • The account uses a Workspace domain where the admin turned off less secure app access or SMTP.
  • Using a full name or alias instead of the full primary email address as the username.

How to fix it

  1. Set the username to the full address, for example user@example.com.
  2. Turn on 2-Step Verification for the account, then create an app password at myaccount.google.com and paste it without spaces.
  3. If the app supports OAuth 2.0 for Google, switch to that instead of a password.
  4. For devices in a Workspace organisation, consider the SMTP relay service in the Admin console, which can authenticate by IP.

Checks that apply

  • SMTP Diagnostics Tests the connection to smtp.gmail.com on port 587 or 465 so you know the network path and TLS are fine before debugging logins.
  • TCP Port Test Confirms outbound ports 587 and 465 are open from your network.

The classification runs without network lookups and we never store your paste.

FAQ

Why does my password work in the browser but not SMTP?
Google blocks basic password sign-in for third-party apps. The browser uses a modern sign-in flow; SMTP needs an app password or OAuth.
I do not see the app passwords option. Why?
App passwords require 2-Step Verification, and Workspace admins can disable them. Ask your admin.

Google Postmaster Tools Google email sender guidelines

All 191 bounce codes