Debugging SMTP 535 Error When OAuth2 Scope Lacks Email Send Permission
Resolve SMTP 535 errors caused by missing email send permission in OAuth2 scopes. Learn how to identify and fix the root cause with clear steps and.
Why Does SMTP 535 Appear When OAuth2 Auth Fails?
Ever tried sending an email via Gmail’s SMTP with OAuth2, only to hit a 535 error with no clear reason? You’re not alone. The error appears even when your code and network settings are correct—because the real issue isn’t in your app, but in the OAuth2 token itself.
SMTP 535 means the server rejected your authentication credentials during the handshake. In OAuth2 flows with Google or Microsoft services, this almost always means the token scope doesn’t include the required permission to send mail—specifically, the https://mail.google.com/ scope for Gmail. It’s not a broken config or a firewall. It’s a missing permission, silent until you try to send.
Key takeaways
- SMTP 535 during OAuth2 authentication typically indicates a missing 'send email' scope in the token, not a network or config error.
- Google’s OAuth2 requires explicit
https://mail.google.com/scope to authorize outgoing mail—without it, auth fails silently. - Even if the token is valid, lacking the correct scope triggers a 535 rejection at the SMTP level, regardless of other setup correctness.
What Does SMTP 535 Mean in OAuth2 Context?
SMTP 535 means authentication failed when sending email via OAuth2. Even if your token is valid, the server rejects it because the token lacks permission to send emails—specifically, the https://mail.google.com/ scope or equivalent. This isn't a token expiry issue; it's a missing permission. You’re logged in, but not authorized to act.
OAuth2 Authentication vs. Traditional SMTP
Unlike older SMTP systems that use plain username/password, OAuth2 relies on tokens. The AUTH PLAIN or XOAUTH2 mechanism exchanges a valid access token instead of a password. If the token checks out but you still get 535, the problem isn’t the token itself—it’s the scope it was issued with.
Let’s say you’ve set up a Gmail integration using OAuth2. Your app gets a token, but if it wasn’t scoped to https://mail.google.com/, the SMTP server will reject your request with a 535 error. It’s like having a key but not the right kind—it opens the door, but not the safe inside.
Common Missteps and Fixes
Many developers assume a valid token means “everything works,” but scopes matter. A token with only https://www.googleapis.com/auth/userinfo.email grants access to your profile info—never to email sending. You need explicit send access, often called https://mail.google.com/ or https://www.googleapis.com/auth/gmail.send (or equivalent for other providers).
Check the OAuth2 provider's scope documentation: Google’s Gmail API scopes list each permission and its effect. If you’re building for Mailgun, SendGrid, or other services, ensure you request the exact send or mail.send scope during authorization.
If you’re using a library or SDK, it might not handle scope negotiation correctly. Review how the token is requested, or test with curl and an explicit scope declaration. Debugging logs from the SMTP server often show whether it rejected the token due to “missing scope” or “invalid credentials.”
If you're still unsure whether the token is scoped right, you can validate it using a tool like EmailListChecker's API—it's designed to detect common email infrastructure issues, including authorization flaws, as part of bulk list validation.
The Root Cause: Missing 'email.send' Scope in OAuth2
You’re seeing a 535 error when trying to send email via Gmail’s API because your OAuth2 token lacks the https://mail.google.com/ scope—required to send messages, even if your token is otherwise valid. If your app only asks for https://www.googleapis.com/auth/gmail.readonly or similar scopes, you can read mail, but sending is blocked by design.
What Scope Do You Actually Need?
Most developers start with basic scopes like profile or email—these only grant access to user account data. But to send mail using Gmail’s API, you must explicitly request https://mail.google.com/. Without this, the API returns a 535 error: “Authentication credentials missing or invalid,” even with a fresh, signed token.
This isn’t a bug—it’s intentional. Google enforces granular permissions so apps can’t send mail without explicit consent. If your app only has readonly access, it can’t send, regardless of how securely you’ve authenticated.
Common Missteps and Real-World Fixes
Developers often assume that https://www.googleapis.com/auth/gmail is enough, but it’s not—this scope is ambiguous. The correct, minimal scope for sending is https://mail.google.com/. You’ll also need https://www.googleapis.com/auth/gmail.modify if you want to delete or archive sent messages. Always use the full, documented scope URI.
Check your app’s OAuth2 consent screen in the Google Cloud Console. If email sending isn't listed as a required permission, users won’t be able to grant it. Even if the token is valid, the API will reject send requests.
For context, Google’s official documentation on OAuth2 scopes for Gmail is available at developers.google.com/gmail/api/auth/scopes. It’s the definitive source for what each scope allows—and what it doesn’t.
When you’re debugging, log the scopes included in your token. A token with only https://www.googleapis.com/auth/gmail.readonly is insufficient for sending. Add https://mail.google.com/ to your OAuth2 request and re-authenticate users to fix it. This often resolves 535 errors on the first retry.
If you’re building a tool that sends transactional emails, ensure your integration clearly communicates this need during user authorization. Don’t assume users understand why they’re being asked for “send” permission.
How to Verify the OAuth2 Scope in Your App
If you’re getting an SMTP 535 error when trying to send via Gmail’s API with OAuth2, the most likely cause is missing the https://www.googleapis.com/auth/gmail.send scope. You’re likely requesting only basic profile access or other scopes, but no permission to send email. Double-check your client setup and scope list—adding this specific scope resolves the error in most cases.
Check Your OAuth2 Client Initialization
- Review the code where you initialize your OAuth2 client (e.g., in Google Cloud Console or within your app's auth flow).
- Look for where scopes are defined—usually passed as an array of strings during token request setup.
- Ensure the array explicitly includes
https://www.googleapis.com/auth/gmail.send, not justhttps://mail.google.com/(though that may work in practice, it’s less reliable).
Verify the Scope List in Your Token Acquisition Flow
- When your app requests a token, the scope list is sent with the authorization request.
- Use tools like Google’s official quickstart guide as a reference for correct scope formats.
- If you're using a library (like Google's client library), confirm it's not auto-reducing or filtering scopes—some SDKs default to minimal access.
- Test the flow with a fresh token, then decode the JWT (via jwt.io) to inspect the token payload and verify
https://www.googleapis.com/auth/gmail.sendappears in thescopefield. - If the scope is missing, update your code or OAuth2 configuration, then repeat the consent flow.
Forcing a re-consent after scope changes is required—users must re-authorize your app with the updated scope list.
The OAuth2 specification requires explicit scope negotiation at authorization time. If your app requests email send access, it must be present in the initial request. Without it, Google’s servers deny the request with a 535 error, often cryptic to end users.
Fixes here are permanent once applied—after re-authentication, the same token should work for send operations. Always test with a small, known-good email address. If the error persists, your server-side SMTP library may not be using the token correctly—ensure it's passed in the Authorization: Bearer header and not as a password.
Correct Steps to Fix the OAuth2 Scope Configuration
If your SMTP 535 error persists with OAuth2, the root cause is likely a missing email send scope. You must ensure your app’s OAuth consent screen approves the specific scope needed to send mail—typically https://mail.google.com/ or https://www.googleapis.com/auth/gmail.send. Without this, even with a valid token, Gmail rejects your request. Correct scope configuration is the essential first fix.
Verify and Update Scope Permissions
- Go to your Google Cloud project’s OAuth consent screen and confirm the scopes listed in your app’s request include
https://www.googleapis.com/auth/gmail.send. If not, add it and submit for verification. Google requires this scope to be explicitly approved before it will issue tokens with send privileges. - In your app’s OAuth2 authentication flow, update the scope list to include
https://www.googleapis.com/auth/gmail.send—not justhttps://www.googleapis.com/auth/gmail.readonly. Some libraries default to read-only access; if you're using one, check its documentation or source code to ensure it doesn’t implicitly restrict scopes. - Re-authenticate the user. This forces a new token to be issued with the expanded permissions. If you reuse an old token, the missing scope won’t be resolved—even if the app’s scope list is now correct.
- Verify that your tool or library isn’t locking scopes. For example, some SMTP gateways or email clients hardcode a read-only scope and ignore additional permissions. If you're using a third-party library, consult its config settings or source to confirm it doesn’t override your requested scopes.
- Test the new token using a command-line SMTP client like
openssl s_clientortelnet. Manually initiate an SMTP session over TLS, sendEHLO,STARTTLS,AUTH PLAIN, and then try sending a test message. If the 535 error disappears, your configuration is now correct.
Validation and Security Best Practices
Always test new tokens in an isolated environment first. You can use inbox placement testing to simulate delivery and validate that the authenticated user can send mail in real-world conditions—especially useful if your app sends transactional or marketing emails.
A single missing scope can block delivery, even with valid credentials. Double-checking the consent screen and token scope at the source eliminates a major class of authentication failures.
Remember: Gmail only grants send access to scopes explicitly approved in the OAuth consent screen. Never assume that a user being "verified" means their token can send mail—only that they’ve granted access to the specified scopes.
Common Mistakes That Lead to This 535 Error
You’re getting a 535 error not because your credentials are wrong, but because your OAuth2 token lacks the https://mail.google.com/ scope, which is required to send emails. The email or profile scopes don’t grant sending access. Even with a valid token, if you didn’t reauthorize after adding the correct scope, the token won’t work. Many libraries auto-choose minimal scopes, so you might not realize you’re missing sending permissions.
Assuming Basic Scopes Cover Sending
- Don’t assume
emailorprofilescopes mean you can send mail. These only grant access to read user data, not send messages. RFC 6749 (the OAuth2 standard) doesn’t require these scopes to include sending capabilities. - Always verify the exact scope your application uses. Use the Google OAuth2 Playground or the official Google OAuth2 scopes list to confirm you need
https://mail.google.com/for email sending.
Overlooking Scope Reauthorization and Libraries
- Changing scopes after initial consent doesn’t update existing tokens. You must reauthorize the app to get a new token with the full scope set. A valid token won’t work if it was issued under a different scope set.
- Some client libraries default to minimal access and don’t expose sending scope options. Let’s say you’re using a library that auto-approves scopes—check its docs or configuration to confirm it lets you add
https://mail.google.com/explicitly. - If you’re using a managed service or SDK, look for a send permission toggle or an explicit
scopesarray. If it’s not configurable, consider switching to a library with more control—like Gmail’s official API client for your language.
It’s easy to overlook scope requirements when integrating with APIs. The best way to verify your setup is to test with a simple send request after full scope authorization. If the 535 error persists, double-check your API key, token validity, and the exact scope string in use—mistakes here are more common than syntax errors.
Use our real-time email verification API to validate recipient addresses before sending, reducing the risk of authentication errors caused by invalid or unverified emails during delivery.
How Email Verification Can Prevent This Issue Earlier
Before you send campaigns, run your entire email list through a bulk verifier like Emaillistchecker.io. This catches invalid, role-based, and disposable addresses early—many of which, while technically valid, may not support sending via OAuth2 due to restricted account access or closed inboxes. Fixing these issues upfront avoids wasted sends and backend failures like SMTP 535 errors tied to insufficient token scopes.
Find the Weak Links in Your List
You might assume an email is valid if it passes basic syntax checks. But a true email address isn’t always a usable sending endpoint. Role accounts (like admin@, support@) often restrict outbound mail, and disposable domains typically block any form of authenticated sending—especially with OAuth2 authentication, which requires full mailbox permissions.
Let’s say your bulk list includes 10,000 addresses. Without verification, you send to 150 invalid or unresponsive ones. If even one is a restricted role account or a temporary disposable inbox, you may get a 535 error when your API tries to authenticate. The problem isn’t the authentication flow—it’s that the target mailbox simply can’t accept sent mail.
Preemptive List Cleaning Reduces Sending Risks
Email verification tools such as Emaillistchecker.io use multiple layers—SMTP checks, DNS validation, and role-account detection—to filter out accounts with known constraints. Their 98.9% accuracy means you can trust the results. This isn’t just about eliminating typos: it’s about catching accounts that appear valid but fail under real-world sending conditions.
Tools like bulk email verification scan thousands of addresses in minutes, identifying catch-all, temporary, or role-based addresses that would otherwise trigger backend failures. A well-cleaned list reduces the risk of hitting SMTP 535 errors not because of OAuth2 misconfiguration, but because you're no longer sending to accounts without send privileges.
Even if your token has the correct scopes, a mailbox with no send access (like many role accounts) will reject your message. That’s why verifying your list isn’t just about deliverability—it’s about aligning your sending process with actual mailbox capabilities. According to the SMTP RFC, mail servers accept or reject messages based on the recipient’s actual capacity, not just the email format.
By proactively cleaning your list, you avoid sending to endpoints that won’t accept your message—not due to a technical error, but because they lack the necessary account rights. This reduces bounces, protects sender reputation, and keeps your outbound campaigns running smoothly, even when authentication is otherwise configured correctly.
Using Emaillistchecker.io to Validate Email Lists Before OAuth2 Send Attempts
You can prevent SMTP 535 errors caused by invalid or restricted email addresses by verifying your list before attempting OAuth2 authentication and send requests. Emaillistchecker.io checks each email for validity, catch-all status, and risk factors, helping you filter out addresses that will fail—especially those tied to restricted tokens—before they consume API resources or trigger authentication failures.
Steps to Prevent OAuth2 Failures with Pre-Send Validation
- Import your email list into Emaillistchecker.io via the bulk upload tool. This is the foundation of a clean send. A list with outdated, malformed, or non-existent addresses will result in unnecessary SMTP 535 errors, even if your OAuth2 token has the correct scope—if the target doesn’t exist, the auth process fails early.
- Run bulk verification. The service checks each address across multiple layers: DNS, mailbox existence, role accounts, disposable domains, and catch-all patterns. Your list will return verdicts like
valid,invalid,catch-all, orrisky. Catch-alls may respond to SMTP commands but won’t accept inbound mail reliably; risky addresses often have high bounce rates or are associated with temporary or automated domains. - Filter out risky and catch-all addresses. These are the most likely to cause send failures—even with correct OAuth2 permissions. If your token lacks the ability to send to certain domains or subdomains (e.g., those with strict inbound policies), sending to them can still trigger 535 errors. Removing these reduces unnecessary strain on your OAuth2 flow and prevents misleading reports of token misconfiguration.
- Use the real-time API or integrations to automate the process. With integrations for Mailchimp, SendGrid, HubSpot, and Klaviyo, you can validate new subscribers before they’re added to your campaigns. The API enables you to validate email addresses in real time during onboarding, ensuring only deliverable addresses progress to the send layer.
- Review results and send only validated addresses. Your verified list now includes only addresses that pass deliverability checks, meaning OAuth2 authentication will likely succeed—provided your token scope is correct. This cuts down on retries, token throttling, and delivery failures.
Why This Matters for OAuth2 and SMTP 535
SMTP 535 errors often stem from authentication rejection, but not all are due to token issues—some are because the recipient address is invalid or the domain blocks outgoing mail under certain conditions. According to RFC 5321, servers reject messages for invalid recipients or policy enforcement, regardless of auth status. Without pre-verification, you're sending auth attempts to addresses that will never accept mail, wasting tokens and increasing risk of rate limits.
Using Emaillistchecker.io’s bulk verification or real-time API ensures you’re not testing sendability against dead zones. Even with the correct OAuth2 scope, you can’t send to non-existent or protected inboxes. Clean lists mean fewer errors, lower bounce rates, and stronger sender reputation.
What to Do If the Token is Valid but SMTP 535 Still Occurs
If the OAuth2 token is valid but you’re still getting an SMTP 535 error when trying to send via Gmail’s SMTP server, the issue is likely not with token authentication itself—but with the permissions tied to it. Double-check that your OAuth2 scope explicitly includes https://mail.google.com/ (or https://www.googleapis.com/auth/gmail.send), as sending emails requires this specific access. Even a valid token without the right scope will fail silently during the AUTH phase. This is a common misstep in Gmail’s OAuth2 implementation.
Verify the Token and Connection Flow
- Check your server-side logs for the exact error response. Some providers return extended error messages beyond the 535 code—look for clues like
Insufficient permissionsorInvalid scope. - Confirm your SMTP client is sending the
AUTH XOAUTH2command with the full, correctly formatted token, including theauth=Bearerprefix. - Ensure your app’s OAuth2 library correctly handles Gmail’s SMTP requirements: use port 587 with TLS, not 465, and avoid older protocols like PLAIN.
Test Isolation and Debugging
- Test the same OAuth2 token using a known-working tool like Postman with the OAuth2 flows properly configured. If it works in Postman but fails in your code, the issue is in your implementation.
- Use a tool like RFC 2821 (the SMTP standard) to verify that the client handshake sequence is followed exactly—especially the
STARTTLScommand prior to AUTH. - Check that your API application’s consent screen includes the required scopes, and re-apply authorization if you’ve updated the scope list.
- If you’re using a service like Gmail, refer to the official Gmail API OAuth2 Scopes documentation for exact permissions and ensure your app is properly authorized in the Google Cloud Console.
Don’t assume the token is sufficient because it’s valid and has not expired. The key is the grant—your app must have been granted the right to send emails, not just access user data. Use a real test email account and a verified OAuth2 client ID to prevent scope confusion.
How Sender Reputation and List Quality Affect SMTP Auth Success
Even if your OAuth2 token has the right scopes, sending to a polluted list can still trigger SMTP 535 errors—not because authentication failed, but because the receiving server rejects your message based on sender reputation, poor engagement, or high spam risk. Deliverability isn't just about authentication; it's about trust, and trust is earned through consistent, quality sends.
Reputation is not just a score—it’s behavior
SMTP servers evaluate your domain’s reputation long before they check your OAuth2 token. A domain sending to thousands of inactive or disposable email addresses—even with valid credentials—will get flagged as risky. ISPs and email providers use behavioral signals: bounce rates, open rates, complaint rates, and inbox placement. If your list includes many role accounts like admin@ or support@, or domains known for temporary sign-ups, your messages are far more likely to be rejected or filtered.
Studies show that domains with high bounce and complaint rates see inbox placement drop below 70% even when authentication is correct. The MxToolbox Reputation Checker (https://mxtoolbox.com/) and Spamhaus provide public tools to assess domain reputation, but they don’t tell you what’s happening inside mailboxes. That’s where real-time inbox placement testing becomes essential.
Prevent rejection before it happens
Let’s be clear: fixing an SMTP 535 error with a token is only half the battle. The other half is ensuring your send list doesn’t already carry the fingerprints of spam. You can’t rely on your email service provider’s filters alone—they’re reactive. Proactive screening is how you avoid being blocked.
Using Emaillistchecker.io’s inbox-placement testing gives you a real-world preview of where your messages land—inbox, spam, or rejected—before you send. It checks for role accounts, disposable domains, invalid syntax, and inactive addresses. With a 98.9% accuracy rate and no expiration on purchased credits, bulk verification is a low-risk way to maintain sender health.
The platform also integrates with major ESPs like Mailchimp, HubSpot, Klaviyo, and SendGrid—so you can verify lists at scale, without disrupting workflows. If you're sending through OAuth2 with full access, make sure your list quality matches your intent. Your token may be valid, but if the list is toxic, the server will still say no.
Conclusion: Fix the Scope, Clean the List, Ensure Deliverability
SMTP 535 errors during OAuth2 authentication are rarely about misconfigured servers. More often, they indicate that your app’s token scope doesn’t include permission to send emails.
Always confirm that your application requests exactly the required scope: https://mail.google.com/ or https://www.googleapis.com/auth/gmail.send. Missing this permission breaks authentication before delivery even begins.
Even with correct scopes, poorly maintained email lists lead to bounces, poor sender reputation, and eventual inbox placement failure. Use email verification to catch invalid, disposable, and risky addresses before sending.
Sources
- Gmail classifies anyone sending close to 5,000 or more messages to personal Gmail accounts in 24 hours as a bulk sender — and that status is permanent once triggered. — Google Email Sender Guidelines FAQ (2024)
Keep reading
- Bulk email verification and list cleaning: when and how to verify (complete guide)
- Pre-Send Email Validation to Detect UTF-8 Encoding Errors
- How to Fix SMTP 250 Acceptance with Unverified Sender IP in Proxy Setup
- Validating DNSSEC in Domain Zone with Expired Signatures and Keys
- How to Validate SMTP 250 Success Code with Null RCPT TO
Ready to put this into practice? Emaillistchecker.io verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
What does SMTP 535 mean when using OAuth2?
SMTP 535 indicates authentication failure. With OAuth2, this usually means the token lacks permission to send email, despite being valid.
Does the 'email' scope allow sending mail via OAuth2?
No. The 'email' scope only grants access to the user’s email address. To send mail, you must include 'https://mail.google.com/' or 'https://www.googleapis.com/auth/gmail.send'.
Can I fix the scope without reauthorizing the user?
No. Changing the scope requires a fresh authorization flow. The old token cannot be upgraded; you must reauthenticate.
How do I test if my OAuth2 scope is correct?
Use telnet or openssl to connect to Gmail’s SMTP server on port 587 with TLS, then attempt AUTH XOAUTH2 with your token. A 535 response means scope issues.
What if my token has the send scope but I still get 535?
Check if the token is being sent correctly in the SMTP command, verify the library supports Gmail's SMTP, and review server logs for detailed errors.
How does email verification help prevent SMTP 535 errors?
While verification doesn't fix OAuth2 scopes, it removes invalid and risky addresses that may trigger backend failures or poor deliverability, which indirectly improves authentication success.
Are there tools that automatically check OAuth2 scopes for send permission?
No fully automated tools exist for scope validation. You must manually check the authorization configuration in your cloud provider dashboard.
Does Emaillistchecker.io support bulk verification for OAuth2 testing?
Yes. Emaillistchecker.io offers bulk verification, real-time API checks, and integrations with SendGrid, Mailchimp, and Klaviyo to test list quality before sending.
Can disposable domains cause SMTP 535 errors?
No. Disposable domains are invalid addresses. They cause rejection during SMTP handshake, not due to OAuth2 scope issues. They should be filtered out before sending.
Do I need to re-authenticate every time I change scopes?
Yes. OAuth2 scopes are set during authorization. Changing them requires the user to reauthenticate with the updated scope list.
Is 98.9% accuracy in email verification guaranteed for all domains?
No. Accuracy depends on domain policies, mail server configurations, and the current state of an address. Emaillistchecker.io achieves 98.9% combined accuracy across verified lists.
Can I use Emaillistchecker.io with SendGrid and Mailchimp?
Yes. Emaillistchecker.io integrates directly with SendGrid, Mailchimp, HubSpot, and Klaviyo to clean and verify email lists in real time.