535 5.7.8 Username and Password not accepted Email / SMTP Origin: Network OSI layer 7 · Application Last updated 4 Nov 2026

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

The server received your login but rejected it — wrong username or password, an unusable password type, or a blocked sign-in.

Exact message you may see 535-5.7.8 Username and Password not accepted535 5.7.8 Username and Password not acceptedBadCredentials 535535 Authentication failed535 5.7.3 Authentication unsuccessful
Seen on: SMTP

Meaning

Gmail returns this for wrong credentials and also when an app password is needed or the sign-in was blocked. Use the full email address as username, a valid app password (with 2SV), and check Gmail's security alerts for a blocked sign-in. For other providers, confirm SMTP is enabled for the mailbox.

Common causes

  • Wrong password or username (must be full address)
  • Account password used instead of an app password
  • App password revoked after a password change
  • Sign-in blocked as suspicious (new server IP)
  • SMTP/IMAP disabled for the mailbox

⚡ Quick fix

  1. Re-enter credentials; use the full email as username
  2. Generate a new app password
  3. Review security alerts and approve the sign-in or unlock captcha: accounts.google.com/DisplayUnlockCaptcha

Detailed fix by platform

Python

  1. Quick test: python3 -c "import smtplib;s=smtplib.SMTP('smtp.gmail.com',587);s.starttls();s.login('you@gmail.com','APP_PASSWORD');print('ok')"

How to diagnose

  1. User — Full email address?
  2. Password — App password if 2SV?
  3. Alerts — Blocked sign-in?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

530 5.7.0 Authentication Required — SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required (Email / SMTP)530 5.7.0 Authenticat…534 5.7.9 Application-specific password required — SMTP: 534-5.7.9 Application-specific password required. Learn more at https://support.google.com/accounts/answer/185833 (Email / SMTP)534 5.7.9 Application…550 5.4.5 Daily user sending quota exceeded — SMTP: 550 5.4.5 Daily user sending quota exceeded (Gmail) (Email / SMTP)550 5.4.5 Daily user …553 5.7.1 Sender address rejected: not owned by user — SMTP: 553 5.7.1 <noreply@example.com>: Sender address rejected: not owned by user user@example.com (Email / SMTP)553 5.7.1 Sender addr…ActionMailer: SMTP From address may not be blank / Net::SMTPAuthenticationError — Rails: ArgumentError: SMTP From address may not be blank: nil / Net::SMTPAuthenticationError: 535 5.7.8 Username and Password not accepted (Ruby / Rails)ActionMailer: SMTP Fr…DKIM: body hash did not verify — DKIM: dkim=fail (body hash did not verify) / signature verification failed (Email / SMTP)DKIM: body hash did n…IMAP: [AUTHENTICATIONFAILED] Invalid credentials — IMAP: NO [AUTHENTICATIONFAILED] Invalid credentials (Failure) (Email / SMTP)IMAP: [AUTHENTICATION…Nodemailer: EAUTH Invalid login — Nodemailer: Error: Invalid login: 535-5.7.8 Username and Password not accepted (code: 'EAUTH', responseCode: 535) (Email / SMTP)Nodemailer: EAUTH Inv…535 5.7.8…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.