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.
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 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
- Re-enter credentials; use the full email as username
- Generate a new app password
- Review security alerts and approve the sign-in or unlock captcha: accounts.google.com/DisplayUnlockCaptcha
Detailed fix by platform
Python
- 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
- User — Full email address?
- Password — App password if 2SV?
- 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:
Similar errors
- 530 5.7.0 Authentication Required SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required
- 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
- 550 5.4.5 Daily user sending quota exceeded SMTP: 550 5.4.5 Daily user sending quota exceeded (Gmail)
Most viewed in Email / SMTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026