Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
SMTP Responses
The Simple Mail Transfer Protocol (SMTP) is an application layer protocol that enables email communication between mail servers. SMTP operates on a request-response model where the client sends commands and the server responds with standardized three-digit status codes accompanied by descriptive text messages.
SMTP Communication Model
SMTP communication follows a structured approach where the client initiates requests and the server provides responses. Each server response contains a three-digit numeric code that indicates the status of the requested operation, making it easy for clients to programmatically handle different scenarios.
SMTP Response Code Structure
SMTP response codes consist of three digits, where each digit has a specific meaning:
-
First digit (2-5) Indicates the overall response category
-
Second digit (0-5) Specifies the response subcategory or error type
-
Third digit (0-9) Provides additional detail about the specific condition
Response Categories by First Digit
| First Digit | Category | Meaning |
|---|---|---|
| 2 | Positive Completion | Command completed successfully |
| 3 | Positive Intermediate | Command accepted, awaiting further information |
| 4 | Transient Negative | Temporary failure, retry later |
| 5 | Permanent Negative | Command failed, do not retry |
Common SMTP Response Codes
| Code | Category | Description |
|---|---|---|
| 220 | Positive | Service ready, connection established |
| 250 | Positive | Requested action completed successfully |
| 354 | Intermediate | Start mail input, end with <CRLF>.<CRLF> |
| 421 | Temporary | Service not available, closing connection |
| 450 | Temporary | Mailbox unavailable or busy |
| 500 | Permanent | Syntax error, command unrecognized |
| 550 | Permanent | Mailbox unavailable or access denied |
| 554 | Permanent | Transaction failed |
SMTP Protocol Constraints
SMTP implementations must adhere to specific limits to ensure reliable communication:
-
Command line length Maximum 512 characters including CRLF
-
Text line length Maximum 1000 characters including CRLF
-
Path and domain names Maximum 256 characters
-
Local part (username) Maximum 64 characters
Conclusion
SMTP response codes provide a standardized way for mail servers to communicate the status of email operations. The three-digit structure allows clients to quickly determine whether commands succeeded, failed temporarily, or failed permanently, enabling appropriate error handling and retry logic.
