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

Code

Explanation

101

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

Positive response

211

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

214

It responds with a help message.

220

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

221

The transmission channel will be closed by the SMTP server.

235

When the Authentication of the connection is successful.

250

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

251

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

252

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

Positive Intermediate Response

334

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

354

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

Temporary Negative Response

421

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

422

When the recipient mailbox capacity has exceeded the limit.

431

When a particular message is sent many times.

441

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

442

Connection terminated.

449

This code executes when a routing error occurs.

450

The Mailbox is not available.

Permanent Negative Response

500

Syntax error and SMTP server could not find the command.

501

It is another type of Syntax error in the arguments.

502

The Command is not implemented.

510

Bad Email address.

513

Spelling mistake in the Email Address.

530

Authentication Problem on the server side.

550

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

553

Incorrect mail address.

554

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.

Conclusion

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

581 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements