SMTP

SMTP 221 Closing Connection vs 235 Authentication Successful

Both SMTP 221 (Closing Connection) and 235 (Authentication Successful) belong to the 2xx Positive Completion category. 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. Meanwhile, 235 means that the client has been successfully authenticated using the AUTH command. The server will now accept mail commands from this authenticated session.

描述

The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.

何时出现

After sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.

如何修复

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.

描述

The client has been successfully authenticated using the AUTH command. The server will now accept mail commands from this authenticated session.

何时出现

After submitting valid credentials via the AUTH command (LOGIN, PLAIN, or other SASL mechanism). The server has verified your identity and you can now send mail.

如何修复

No fix needed — authentication succeeded. If you expected this but received a different code, double-check your username, password, and the authentication mechanism.

主要区别

1.

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.

2.

SMTP 235: The client has been successfully authenticated using the AUTH command. The server will now accept mail commands from this authenticated session.

3.

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.

4.

You encounter 235 when after submitting valid credentials via the AUTH command (LOGIN, PLAIN, or other SASL mechanism). The server has verified your identity and you can now send mail.

何时使用哪个

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 235 (Authentication Successful): No fix needed — authentication succeeded. If you expected this but received a different code, double-check your username, password, and the authentication mechanism.

了解更多