3-digit reply code Success

SMTP error 221

Service closing transmission channel.

Updated Jul 1, 2026

The short answer

SMTP 221 is not an error. It is the normal, successful reply a server sends after QUIT to say it is closing the connection cleanly — "Service closing transmission channel." If your mail still failed, the real cause is an earlier 4xx or 5xx line in the transcript, not the 221.

Quick fix

Normal end-of-session message. Nothing to do.

2 - Success. Not an error - the server accepted or completed the action.

What it means

Every healthy SMTP session ends in 221. After your client sends QUIT, the server is required to answer with 221 and close the channel. So seeing 221 in a log means the conversation ended gracefully — the server handled everything it was given this session. Many servers prepend the enhanced code 2.0.0 ("success"), giving lines like "221 2.0.0 Bye". Authentication problems, by contrast, show up as 535 or 530 — never as 221, so do not chase credentials on the strength of a 221.

Common causes

A failure happened earlier

Scroll up. A 4xx (temporary) or 5xx (permanent) line before the 221 is the actual error. A 550 rejection followed by 221 just means the server refused the mail, then closed normally.

The server closed before you sent QUIT

Some servers drop idle connections or hit a per-session limit and send 221 (or 421 on a forced shutdown) mid-transaction. Treat that as a connection-handling issue — reduce idle time or concurrency and add reconnect logic.

Your code read 221 as delivery confirmation

Acceptance is signaled by 250 after DATA, not 221. If success is keyed off 221, that is a bug.

How to fix it

  1. Read the line before the 221

    If it is a 250, that hop accepted your message. If it is a 4xx or 5xx, that line is your real error — look that code up instead.

  2. Capture the full transcript

    The 250 is where acceptance happens; the 221 is just the clean close.

    S: 250 2.0.0 OK: queued as 9F2C1
    C: QUIT
    S: 221 2.0.0 Bye
  3. Fix success detection in code

    Key delivery success off the 250 after DATA, not the 221.

Common questions

Is 221 an error?

No. It is a positive completion reply ("Service closing transmission channel") sent after QUIT, marking a normal end to the session.

My email failed but I got a 221 — why?

The 221 only means the session closed cleanly. The failure is an earlier 4xx/5xx line in the same transcript — that is where the fix lives.

Related codes

Ready when you are

Most rejections come back to sender reputation.

Blocklists, auth failures, and policy blocks are what warmup prevents. Warm up your domain so your mail is trusted before you hit send.

7-day free trialNo credit cardCancel anytime