501 5.5.2: cannot decode response
Gmail could not decode a reply your client sent, which during SMTP sign-in usually means a malformed base64 string in the AUTH exchange.
- Gmail
- Provider
- Permanent (5xx)
- Class
- Sources checked
- Author
At a glance
- Code
- 501 5.5.2
- Provider
- Gmail and Google Workspace
- Temporary or permanent
- PermanentRefused for good: the message comes back to the sender, and resending it gets the same answer.
- Who has to act
- The sender. The fix is on the sending side: your domain, your server or your list.
- What the server says
501 5.5.2 Syntax error, cannot decode response.
What it means
During SMTP authentication the client answers the server's challenges with base64-encoded strings. 'Cannot decode response' means Gmail could not decode what came back, so it refused that step. The usual cause is a client that sends a user name or password without base64 encoding, encodes it wrongly, or adds stray characters such as a line break inside the string. It points to a client bug, or to a mistyped string in a manual test, so correct the encoding and try again.
Common causes
- A user name or password sent in plain text where base64 was expected.
- Incorrect base64, such as a line break or a padding error inside the string.
- A manual telnet or openssl test with a mistyped string.
How to fix it
- 01Check how your client encodes the AUTH LOGIN or AUTH PLAIN strings.
- 02In manual tests, generate the base64 string with a tool and paste it without line breaks.
- 03Use a maintained mail library instead of hand-built AUTH commands.
Sources
What this page rests on, checked on 20 Oct 2026. The explanation is ours; the reply text is the server's.
- Gmail SMTP errors and codes (Google Workspace Admin Help)knowledge.workspace.google.com
Related codes
- 535 5.7.8Username and password not accepted.Google rejected the user name and password your client used to sign in to its SMTP server, so it will not send mail for it.
- 501Syntax error in arguments.The command was recognised, but what came with it was malformed, often an address or a host name the server cannot accept.
- 5.5.2SMTP syntax error.A command from the sending software could not be understood, because its syntax was wrong or the command was not recognised at all.
All 108 Gmail codesEvery code in the wikiPaste your own bounce