SMTP 221 Closing Connection vs 354 Start Mail Input
SMTP 221 (Closing Connection) is a 2xx Positive Completion response, while 354 (Start Mail Input) is a 3xx Positive Intermediate response. 221 indicates that the server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session. In contrast, 354 means that the server is ready to receive the message body. The client should begin sending the email content (headers and body) and terminate with a single line containing only a period (CRLF.CRLF).
Descrição
The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
Quando você o vê
After sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
Como corrigir
No fix needed — this is the expected response when ending an SMTP session. If you see this unexpectedly, the server may be shutting down or timing out idle connections.
Descrição
The server is ready to receive the message body. The client should begin sending the email content (headers and body) and terminate with a single line containing only a period (CRLF.CRLF).
Quando você o vê
After sending the DATA command. The server is now waiting for you to type or stream the email message, ending with a dot on its own line.
Como corrigir
Send your message content followed by a line with just a period (.) to signal the end. If you get an error after this, check that your message does not contain a bare period on a line by itself within the body.
Diferenças principais
221 is a 2xx Positive Completion response, while 354 is a 3xx Positive Intermediate response.
SMTP 221: The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
SMTP 354: The server is ready to receive the message body. The client should begin sending the email content (headers and body) and terminate with a single line containing only a period (CRLF.CRLF).
You encounter 221 when after sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
You encounter 354 when after sending the DATA command. The server is now waiting for you to type or stream the email message, ending with a dot on its own line.
Quando usar qual
For 221 (Closing Connection): No fix needed — this is the expected response when ending an SMTP session. If you see this unexpectedly, the server may be shutting down or timing out idle connections. For 354 (Start Mail Input): Send your message content followed by a line with just a period (.) to signal the end. If you get an error after this, check that your message does not contain a bare period on a line by itself within the body.