534-5.7.9 Please log in with your web browser: Gmail SMTP fix
The error 534-5.7.9 Please log in with your web browser and then try again means Gmail refused your SMTP sign-in and wants a browser login. The lasting fix is an app password (with 2-Step Verification on) or OAuth, not your normal password typed into an old client. Here is how to tell which one you need.
Sohail Hussain9 min readShort answer
- Gmail is refusing a password-only SMTP sign-in. Logging in through a browser is a temporary workaround at best, and Google has since turned off password-only access for most accounts.
- Switch the app to OAuth ("Sign in with Google") if it supports it. If it doesn't, turn on 2-Step Verification, create an app password, and use that in place of your Google password.
- Then check for a blocked sign-in alert, a revoked app password, and Workspace admin restrictions.
You are probably seeing this in a mail client, script, plugin or printer log:
534-5.7.9 Please log in with your web browser and then try again.
Some libraries add the tag WEBLOGINREQUIRED. The usual story, in a 2013 thread and in many threads since, is that logging in through the web fixes it for a while and then it comes back. That pattern points at a sign-in policy problem, not a broken mail server.
What the error means
534 is a permanent (5xx) SMTP reply, and it came from Gmail's server at smtp.gmail.com during authentication. The enhanced code 5.7.x sits in the security and policy class. The message is about your login, so nothing was sent and nothing bounced. The recipient is not involved.
One detail on the code: Google's current Gmail SMTP errors table lists the "log in with your web browser" wording under 5.7.14 and 5.7.90, and the app-password message under 5.7.90. The exact 5.7.9 string you see is mostly from older threads and from libraries that print it. I could not confirm from Google's docs why it was split into other codes. Treat all of these as the same family: Gmail doesn't trust this kind of sign-in.
Why it happens
Most common first.
- The app signs in with your normal Google password. Google's help says that from May 30, 2022, it stopped supporting third-party apps or devices that sign in with only a username and password. Workspace documentation goes further: less secure app access was scheduled to end for all Google Accounts on March 14, 2025, with SMTP, IMAP and POP no longer working with basic authentication, per Google's OAuth transition page.
- Google flagged this particular sign-in. A new server, a new location or a burst of failed logins can trigger a "sign-in attempt was blocked" review. Approving it in a browser may clear that one block, which explains the "works, then fails" pattern.
- A stored app password stopped working. Google revokes your app passwords when you change your Google Account password, according to its app password help.
- A Workspace admin policy. For work or school accounts, the admin controls whether app passwords exist and which apps are trusted.
- A client retrying the old credential in a loop. This makes Google more suspicious of the account.
I'd skip the browser-login trick entirely. It was a workaround for a policy that has since hardened.
Step-by-step fixes
Fix 1: use OAuth (the preferred route)
Google's own advice is to connect apps with "Sign in with Google" where the app offers it, and it describes app passwords as unnecessary in most cases.
- In your mail client or tool, remove the existing Gmail account that uses a password.
- Add it again and choose Sign in with Google (some tools call it Connect Gmail).
- Complete the consent screen in the browser and allow the requested access.
- Send a test message.
If you write the code yourself, Google's IMAP, POP and SMTP for Gmail page says the SMTP server supports OAuth 2.0 through the SASL XOAUTH2 format. It also says an OAuth session lasts about as long as the access token, usually 1 hour, so refresh the token before reconnecting.
Fix 2: use an app password
Use this when the software only offers a username and password field, such as an older client, a script or a scanner.
- Turn on 2-Step Verification for the Google account. App passwords only work on accounts that have it.
- Open Google Account > Security and find App passwords. Search for "App passwords" in your account settings if the menu has moved.
- Create one and name it after the app that will use it.
- Copy the 16-character code. Google can show it only once.
- In the app, keep the full Gmail address as the username and paste the app password as the password, without spaces.
- Use these settings:
Host: smtp.gmail.com
Port: 587 (STARTTLS) or 465 (implicit SSL/TLS)
Username: you@example.com
Password: the 16-character app password
Those hosts and ports match Google's developer documentation.
Changing your password breaks app passwords
Google revokes your app passwords when you change your Google Account password. If SMTP worked for weeks and then returned this error right after a password reset, create a new app password and update every app that used the old one.
Fix 3: clear a blocked sign-in
- Open the Gmail account in a browser and look for a security alert about a blocked sign-in.
- If it was your app, confirm it. If you don't recognize it, change your password and review recent activity.
- Stop any client that keeps retrying the old password, then switch to Fix 1 or Fix 2 so the block doesn't return.
Fix 4: Workspace accounts
For work or school accounts, Google says app passwords may be unavailable. Its help lists several reasons the option can be missing:
- 2-Step Verification is set up only for security keys.
- You are signed in to a work, school or other organization account.
- The account has Advanced Protection.
In those cases, ask your Workspace admin. Google's admin guidance says Workspace accounts no longer support less secure apps, and that you must use OAuth, or 2-Step Verification with an app password for clients that can't do OAuth. Office devices such as scanners are covered too: configure OAuth or create an app password.
If your device or software supports neither, Google's printer and app page says older devices might not be able to send email at all. For a server application that sends volume, a dedicated sending provider fits better than a personal mailbox. Google also documents a separate Workspace SMTP relay for on-premise devices and apps; the admin sets that up in Google Admin.
Which cause do you have?
| What you see | Likely cause | Fix |
|---|---|---|
| Fails on the first try with your normal password | Password-only sign-in is no longer accepted | OAuth or app password |
| Worked for weeks, failed after a password reset | App password revoked | Create a new app password |
| Works from your laptop, fails from a server | New location flagged | Confirm the alert, then use OAuth |
| "App passwords" option is missing | 2-Step Verification off, security keys only, Advanced Protection or admin policy | Fix 2-Step Verification or ask the admin |
| Other Workspace users work, you don't | Per-user or admin policy | Ask the admin |
| Fresh app password still fails | Wrong username, spaces in the code, or a blocked sign-in | Use the full address, remove spaces, check alerts |
Checklist before you try again
- The username is the full Gmail or Workspace address.
- The password field holds an app password (or the app uses OAuth), not your Google password.
- The host is
smtp.gmail.comwith port587(STARTTLS) or465(SSL/TLS). - 2-Step Verification is on for the account.
- No old client is still retrying the previous password.
- You checked the account's security alerts for a blocked sign-in.
How to stop it coming back
- Give each app its own app password so you can revoke one without breaking the rest.
- Prefer OAuth wherever the software offers it.
- Don't point several tools at one mailbox with the same stale credential.
- Keep sending volume modest on a personal mailbox. Our guide to email throttling and rate limits explains why bulk mail belongs on a proper sending provider. The SMTP glossary entry covers the basics of the protocol.
If nothing works
A fresh OAuth connection or app password that still returns this error needs Google or your Workspace admin. Personal accounts go through Google Account help. Workspace users should ask the admin, who can open a support case.
Gather:
- the exact error text, including the trailing
gsmtpmarker if there is one - the time of the failure with timezone
- the client or library name and version
- whether the account is personal or Workspace
- what you already tried (app password, OAuth, alert confirmation)
You can paste the raw SMTP transcript if you remove the password. If you have the bounce or error headers, our email header analyzer helps you read them.
Subject: SMTP sign-in rejected with 534-5.7.9 on smtp.gmail.com
Hello,
Sending through smtp.gmail.com (port 587, STARTTLS) fails with:
534-5.7.9 Please log in with your web browser and then try again.
Account: you@example.com (personal / Google Workspace)
Client or library: {name and version}
First failure: {date, time, timezone}
Already tried: new app password, OAuth sign-in, confirmed the security alert
Please tell us whether this account or sign-in is restricted and what we need to change.
Thank you
Common questions
Does logging in through my browser fix it permanently?
No. At most it approves one blocked sign-in. If the app still sends your password, Google can block it again, so move to OAuth or an app password.
Is "less secure apps" still an option?
Google's Workspace admin documentation says less secure app access was scheduled to be turned off for all Google Accounts from March 14, 2025, and that the admin setting is no longer available. Don't plan around it.
Why can't I find "App passwords" in my Google Account?
Google lists three common reasons: 2-Step Verification is only set up for security keys, the account is a work or school account, or Advanced Protection is on. For Workspace, the admin decides.
Can I just use a different port?
Switching between 587 and 465 doesn't change authentication. Both ports accept the same credentials, so the sign-in method is what matters.
Explore: Email Deliverability
Related Articles
421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix
The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.
421 4.7.0 Temporary System Problem. Try again later (10)
`421 4.7.0 Temporary System Problem. Try again later (10).` is a temporary Gmail deferral, not a permanent rejection. Google's server asked your sender to retry later. Slow your send rate, let your mail server retry, and check authentication and reputation if the deferrals last more than a day or two.
421-4.7.0 Try again later, closing connection (EHLO): fix
The error "421-4.7.0 Try again later, closing connection. (EHLO)" means Google's SMTP server is temporarily refusing your session, usually because of connection volume, a low-reputation IP, or a weak relay setup. Slow down, reuse one connection, queue with retries, authenticate, and send a real EHLO hostname.
421 4.7.28 Gmail Unusual Rate of Unsolicited Mail: Fixes
The 421 4.7.28 error is a temporary Gmail deferral, not a block. Gmail is rate limiting a domain, DKIM domain or IP range it sees sending too much unwanted mail. Retries usually deliver, but you should fix authentication, unsubscribe headers, sending pace and shared infrastructure to stop it recurring.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free