The author voluntarily contributed this tutorial as a part of Pepipost Write to Contribute program.
SMTP (Simple mail transfer protocol) is used to send emails across the network with the help of MTA (Mail transfer agent). On Basis the response from the client’s server SMTP returns a particular error code. These response codes might be one of the five standard classes.
Status code is differentiated into five categories as follows :
Unable to connect to server
System status message
A response to the HELP command
The server is ready
The mail communication channel is getting closed
Requested mail action okay completed
mail will be forwarded because server was not able to find user on local
Cannot verify the user, but it will try to deliver the message anyway
Start adding mail input
Timeout connection problem
Service is unavailable due to a connection problem
The recipient’s mailbox has exceeded its storage limit
Not enough space on the disk
Recipient’s incoming mail queue has been stopped
The recipient’s server is not responding
The connection was dropped during the transmission
The maximum hop count was exceeded for the message
Message timed out because of issues concerning the incoming server
User’s mailbox is unavailable
Aborted – Local error in processing
Too many emails sent or too many recipients
An error of your mail server
Syntax error in parameters or arguments
Bad sequence of commands, or requires authentication
Command parameter is not implemented
510 / 511
Bad email address
Host server for the recipient’s domain name cannot be found in DNS
Address type is incorrect
Size of your mail exceeds the server limits
The recipient address rejected your message
Non-existent email address
User not local or invalid address – relay denied
Exceeded storage allocation
Mailbox name invalid
Transaction has failed
This is Success status which indicates that there is a positive response from the server which might have more information when the response has it respected subcodes (2XX X.X.X) and response.
This should be treated as a positive remark for delivery. Since the status code response represents that the email address you are trying to reach is valid.
If there is an issue with authentication this status code response is received from the server. it can be an incorrect password or username or you might be trying the connect to the wrong mail server. you can check your SMTP access is enabled or not for sending email from your email id or try changing the authentication method.
If you are confident with your username and password and still getting the error try using SSL/TLS.
This can be considered as a positive response because this status code response indicates recipient's MX as successfully received your email but has reverted with null response.
The email has been accepted for delivery but the delivery priority was changed. the new priroty will available after the status code besides the response.
This is success status which indicates your email has been successfully delivered at recipient's end without any issue.
This status code are temporary blockage for your emails delivery which should retry sending those emails automatically. This blockage might be due to unusual traffic patterns from sending server IP address, emails having characteristics of spam or recipients MX is too busy accepting emails.
This status code errors when user raises complaints for the emails which has been sent from our mail server.
This status code errors when user raises complaints for the emails which has been sent from our mail servers on a shared IP.
This status code indicates that high volume of mails has been sent from your IP. ie, bulk emailing. Don't send email if you are receiving this status code
check for email subscription list and make sure you are sending emails to user who as subsribed.
This status code response indicates your emails are postponed due to low connectivity percentage to MTA, Bad tokens within the message or unusal traffic of emails having PDF files in it.
The recipient's MX is too busy. Try to resend those emails after few mintues
This Status code is due to excessive traffic or IP data query failure.
5.0.0 Address does not exist
Email id invalid or does not exists
5.1.0 Other address status
A problem occurred during the delivery of this message to this email address.
5.1.1 Bad destination mailbox address
Specified from address or domain mailbox does not exists (anything after '@').
5.1.2 Bad destination system address
Address does not exists or not able to accept mails
5.1.3 Bad destination mailbox address syntax
Invalid or corrupted character in email address
5.1.4 Destination mailbox address ambiguous
Check your spelling of email address and resend
5.1.5 Destination mailbox address invalid
Mail address may be invailid or may have spelling mistakes.
5.1.6 Mailbox has moved
Mailbox may be moved to new location
5.1.7 Bad sender’s mailbox address syntax
Sender's address is invalid syntactically
5.1.8 Bad sender’s system address
Sender's system in the address does not exist or is incapable of accepting.
5.2.0 Other or undefined mailbox status
This error is usually return for which it has class (ie. 1xx,2xx,3xx,4xx,5xx).
5.2.1 Mailbox disabled, not accepting messages
Some changes need to made mandatory for resending mail
5.2.2 Mailbox full
Try increasing your emailbox space capacity
5.2.3 Message length exceeds administrative limit.
The Size of your email has exceeded its limit try removing unwanted text.
5.2.4 Mailing list expansion problem
mailbox saves your email address to whom you are sending or receiving emails, there is problem saving that email addresses.
5.3.0 Other or undefined mail system status
Mail has been accepted normally
5.3.1 Mail system full
mail system at client's is not able accept emails
5.3.2 System not accepting network messages
you need to whitelist the email address through your administrator it has been blocked.
5.3.3 System not capable of selected features
5.3.4 Message too big for system
Message character limit has exceeded
5.4.0 Other or undefined network or routing status
Mail accepted routing status is not available
5.4.1 No answer from host
Configuration issue at recipient's server. you can send again once the issue is resolved at recipient's end
5.4.2 Bad connection
unable to connected or delay in connection
5.4.3 Routing server failure
Error is generated by the sender's server, you need to contact your ISP/ESP.
5.4.4 Unable to route
When emailid or hosts provided is invalid.
5.4.5 Network congestion
Multiple connection on single channel.
5.4.6 Routing loop detected
Sending message to same PMTA from you have sent.
5.4.7 Delivery time expired
Mail is queued for 2-3 days after that it is removed by returning above messagae
5.5.0 Other or undefined protocol status
Something went wrong with protocol while delivering mail which can be well expressed with other status code.
5.5.1 Invalid command
out of sequence or unsupported command used while sending mail
5.5.2 Syntax error
unable to interprete the command due wrong syntax or it is unrecognized.
5.5.3 Too many recipients
Number of recipient is greater than the amount of recipient deliver by protocol
5.5.4 Invalid command arguments
the arguments were out of range or represented unrecognized features
5.5.5 Wrong protocol version
protocol version is mis-match which can't be solved at one go.
5.6.0 Other or undefined media error
Issue with content of the message which cannot be delivered.
5.6.1 Media not supported
Media is not supported by protocol or the system who is going to formard the mail.
5.6.2 Conversion required and prohibited
Message should be converted before it is send/delivery else it will be not delivered.
5.6.3 Conversion required but not supported
Message must be converted in order to be forwared but partically it is not possible.
5.6.4 Conversion with loss performed
This is Warning to the sender that While conversion data may be lost.
5.6.5 Conversion failed
Message conversion was unsuccessful
5.7.0 Other or undefined security status
Something went wrong while validating authentication which can be expressed with other status code.
5.7.1 Delivery not authorized, message refused
Authentication was not successful due to which email was not sent.
5.7.2 Mailing list expansion prohibited
Sending mail is not allowed to particular recipient.
5.7.3 Security conversion required but not possible
Conversion was required to send mail securely which is not possible.
5.7.4 Security features not supported
Authentication not supported at delivery end.
5.7.5 Cryptographic failure
Unable to decrypt the message because the key was wrong or invalid.
5.7.6 Cryptographic algorithm not supported
Unable to decrypt the message because alogrithm was not supported.
5.7.7 Message integrity failure
The message is corrupted or altered
Below is an simple example for sending email using telnet and you can check the response code after every command.
[vikram.sahu@Nl587_wifi ~]$ telnet smtp.pepipost.com 587 Trying 188.8.131.52... #-----------CONNECTION ESTABLISHMENT--------- Connected to smtp.pepipost.com. Escape character is '^]'. 220 ESMTP SMTPNY-LB2 Ready #-----------EHLO or HELO--------------- EHLO pepipost.com 250-smtpbny-lb2.pepipost.com 250-PIPELINING 250-SIZE 50000000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN 250-AUTH=PLAIN LOGIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN #------------MAIL----------------- mail from: firstname.lastname@example.org 250 2.1.0 Ok [success output] #------------RCPT----------------- # rcpt to: email@example.com 250 2.1.5 Ok [success output] #------------DATA----------------- # data # type this to pass input of email body 354 End data with <CR><LF>.<CR><LF> [success output ] This is test mail from your local host server #mail body . # dot(.) for completing the mail body #------------NOOP----------------- 250 2.0.0 Ok: queued as E2R572042D75 [success output] quit # quit from the telnet command prompt #-----------QUIT------------------ 221 2.0.0 Bye Connection closed by foreign host.
I have segregated the above example in below structure where you can easily understand the status code.
CONNECTION ESTABLISHMENT S: 220 E: 554 EHLO or HELO S: 250 E: 504, 550 MAIL S: 250 E: 552, 451, 452, 550, 553, 503 RCPT S: 250, 251 (but see section 3.4 for discussion of 251 and 551) E: 550, 551, 552, 553, 450, 451, 452, 503, 550 DATA I: 354 -> data -> S: 250 E: 552, 554, 451, 452 E: 451, 554, 503 RSET S: 250 VRFY S: 250, 251, 252 E: 550, 551, 553, 502, 504 EXPN S: 250, 252 E: 550, 500, 502, 504 HELP S: 211, 214 E: 502, 504 NOOP S: 250 QUIT S: 221