Skip to content
Gmail and Google Workspace · permanent error

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
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

  1. 01Check how your client encodes the AUTH LOGIN or AUTH PLAIN strings.
  2. 02In manual tests, generate the base64 string with a tool and paste it without line breaks.
  3. 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.

  1. 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.GmailPermanent
  2. 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.StandardPermanent
  3. 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.StandardPermanent

All 108 Gmail codesEvery code in the wikiPaste your own bounce

Beat · paid monitoring

A heartbeat for your email.

Beat runs every check on this site on a schedule: 41 checks, 33 blacklists and real inbox placement. The moment something breaks, it tells you what broke, why it matters, and the exact fix.

example.comWatching
  • SPFpass
  • DKIMpass
  • DMARCp=none
  • Blacklists0 of 33

Illustrative. Your domain, every few hours.

Also from us:Pulse: your own sending infrastructureConsulting: $65/hr, no retainer