SMTP

SMTP Error 501

SMTP error 501 means "syntax error in parameters or arguments" — the address or argument on a MAIL FROM/RCPT TO command is malformed. Here's how to fix it.

Updated Jun 26, 2026

The short answer

SMTP error 501 is a permanent failure meaning "Syntax error in parameters or arguments" (RFC 5321). The server understood the command verb but rejected its argument — usually a malformed MAIL FROM/RCPT TO address, missing angle brackets, stray whitespace, or illegal characters. Fix it by correcting the address syntax (e.g. <user@example.com>) so the command's parameter is well-formed, then resend.

SMTP reply code 501 is a permanent ("5yz") negative reply defined in RFC 5321 §4.2.3 as "Syntax error in parameters or arguments." Crucially, this is different from 500: with a 501 the server recognized the command verb (e.g. MAIL, RCPT, HELO) but found the argument that followed it to be malformed and unparseable. The matching enhanced status codes (RFC 3463) are 5.5.2 (Syntax error) or 5.5.4 (Invalid command arguments).

What causes SMTP error 501?

The argument supplied to an otherwise-valid command violates SMTP grammar. Common triggers:

  • Malformed email address in MAIL FROM: or RCPT TO: — missing @, missing domain, a stray space, or missing angle brackets. RFC 5321 expects MAIL FROM:<user@example.com>.
  • Illegal characters in the address or argument (control characters, unencoded non-ASCII, unbalanced quotes).
  • Empty or extra parameters — e.g. RCPT TO: with nothing after it, or a bare HELO/EHLO with no hostname argument.
  • Address that exceeds RFC limits — the local-part may be at most 64 octets and the domain at most 255 octets (RFC 5321 §4.5.3.1.1–.2). An over-length address can be rejected as syntactically invalid.

Note: 501 is about syntax, not whether the mailbox exists. A nonexistent-but-well-formed recipient produces a 550, not a 501. And an over-long command line is a separate condition: RFC 5321 §4.2.2 explicitly classes "command line too long" under 500, not 501.

How do I fix SMTP error 501?

  1. Read the full server reply. The text after 501 usually names the offending command, e.g. 501 5.5.4 Syntax error in parameters or arguments (MAIL FROM). That tells you exactly which argument to correct.
  2. Correct the address syntax. Ensure every address is a single, fully-qualified local@domain with no leading/trailing whitespace, and (when issuing raw SMTP) wrapped in angle brackets:
MAIL FROM:<sender@yourdomain.com>
RCPT TO:<recipient@example.com>

Strip display names and commas; send one address per RCPT TO.

  1. Validate before sending. Reject or normalize addresses programmatically (trim whitespace, confirm exactly one @, enforce ≤64-octet local-part and ≤255-octet domain) so a bad value never reaches the SMTP conversation.
  2. Check every command argument, not just addresses. Make sure EHLO/HELO is followed by a valid hostname or address literal, and that any ESMTP parameters (e.g. SIZE=, BODY=) use valid values.
  3. Keep command lines within limits. RFC 5321 §4.5.3.1.4 sets the maximum command line (command word plus <CRLF>) at 512 octets. Exceeding it is reported as a 500 ("command line too long") rather than a 501, but the remedy is the same: if a header or argument is very long, restructure it rather than emitting one oversized line.

If you build the SMTP conversation yourself, the most reliable fix is to stop hand-constructing envelope addresses and let a vetted library (Nodemailer, Python smtplib/email) or an API assemble RFC-compliant commands for you. Courier does this on your behalf, validating recipient data before it reaches the provider so syntactically broken addresses are caught early.

Note: 501 is unrelated to authentication or "Less Secure Apps." If you reached this page chasing a Gmail/Workspace auth failure, that is a different error class — use an App Password (with 2-Step Verification) or OAuth2 over port 587 (STARTTLS) or 465 (implicit TLS); both ports are valid per RFC 8314.

FAQ

Common questions

No. 500 means the command verb itself was unrecognized or malformed; 501 means the verb was understood but its parameter/argument is syntactically invalid (e.g. a bad address in MAIL FROM or RCPT TO). Both are permanent 5yz failures, but 501 points you at the argument, not the command name.

One API, every provider

Stop debugging raw provider errors

Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.

Reply-code definitions per RFC 5321 §4.2.3. Last reviewed Jun 26, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.