SMTP Responses

Email communication has been possible only with the help of the SMTP protocol. It is used at the last layer of the OSI (Open Source Interconnection) model. The SMTP has two main parts SMTP client request and SMTP server response. The mode of communication between the client and server is established with the commands. The SMTP Response is sent with a 3-digit number along with the text messages and can be detected using the first digit of the SMTP response.

Simple Mail Transfer Protocol (SMTP)

SMTP is a type of Application layer protocol used to send and receive mail. It can also use an SMTP relay service for sending a bulk of emails continuously without any breaks.

SMTP Response

The process of SMTP involves, the request sent from the SMTP client, and based on the request, it makes SMTP responses using the three-digit code. The response is sent from the Server with three digits numbers and based on the digits it has a different significance. It can have two types of responses namely −

  • Positive Response

  • Negative Response.

Three Digit Code

The response can be determined by looking at the first digit of the three-digit code.

  • When the first digit is 2, it indicates that the response is positive and the command is accepted.

  • When the first digit is 3, it also indicates the positive response and allows sending the data as asked in the command.

  • When the first digit is 4, it indicates a negative response temporary and asks to try sometime later.

  • When the First digit is 5, it comes under the permanent negative response, and the entire command is rejected.

First (2 to 5)

When the first digit is between 2 and 5, then the request can be accepted or incomplete.

Second (0 to 5)

When the second digit is between 0 and 5, using this digit, the type of error can be detected.

Third (0 to 5)

When the third digit is between 0 and 5, it provides the description.

Code and Description of the SMTP Response

The three-digit code response and its brief description are given below −

Indication of First Digit




This code is used when the server address is wrong and it comes under the server connection error.

Positive response


Based on the request, it is a response with the system status.


It responds with a help message.


When a TCP connection is established, based on the client's request, the server responds that it is ready.


The transmission channel will be closed by the SMTP server.


When the Authentication of the connection is successful.


It is like a confirmation message, that the message is transmitted successfully.


The User account is not on the server, so it will rely on another server.


SMTP server will try to send the message to unverified users.

Positive Intermediate Response


When the request is sent on basis of security, it will be responded to with an Authentication command “AUTH”.


The Server after getting the details from the client will allow the regular mail transfer.

Temporary Negative Response


As the transmission channel is closed, the SMTP server will not be available.


When the recipient mailbox capacity has exceeded the limit.


When a particular message is sent many times.


When the response is not received from the mail recipient’s server.


Connection terminated.


This code executes when a routing error occurs.


The Mailbox is not available.

Permanent Negative Response


Syntax error and SMTP server could not find the command.


It is another type of Syntax error in the arguments.


The Command is not implemented.


Bad Email address.


Spelling mistake in the Email Address.


Authentication Problem on the server side.


The Requested response is not performed as the mailbox is unavailable.


Incorrect mail address.


Transaction Failed.

Conditions for the Command line to execute the above code

  • The command line value should have a maximum of 512 characters.

  • The length of the mail is set to a maximum of 998 characters.

  • The path address and the domain name are set to a maximum value of 256 characters.

  • In the mail, the username is also limited to a value of 256 characters.


Simple Mail Transfer Protocol involves the transfer of data in the form of mail and also receives from the recipient’s server. Based on the code, they are broadly classified depending on the positive complete response, positive temporary response, Negative complete response, and Negative temporary response. The Commands are sent along the TCP connection, to get these four types of responses.

Updated on: 03-May-2023


Kickstart Your Career

Get certified by completing the course

Get Started