Skip to content
MtrXTools

535 5.7.8 Username and Password not accepted

The SMTP login was rejected

Seen in Gmail SMTP (smtp.gmail.com), Postfix/Dovecot, apps and scripts

The mail server refused the username and password your app used to log in for sending.

Common causes

  • Using the normal Google account password; Gmail SMTP needs an app password or OAuth.
  • An app password that was revoked, or reset when the account password changed.
  • A wrong username: it must be the full email address.

How to fix it

  1. Turn on 2-Step Verification and create an app password, or switch the app to OAuth 2.0 (XOAUTH2).
  2. For Google Workspace, check the admin has not disabled app passwords or SMTP access.
  3. Use smtp.gmail.com on port 587 with STARTTLS or port 465 with implicit TLS.

Got a different message? Paste it into the error explainer.

Related errors

All 33 Email (SMTP) errors