+2 votes

Getting on really well with your mail.dll, its excellent.

​​Just wondered if I should check if smtp has ENHANCEDSTATUSCODES extension before I use the result.Status to check the result of the send. I didnt think that smtp gave any indication, by default, of how the sending process went.

by

1 Answer

0 votes
 
Best answer

You don't need to do that.

In most cases your SMTP server reports immediate errors only.

Please remember that your SMTP server is not able to check some things immediately.
For example: it is not possible to check if the recipient address that comes from a different domain exists or not
(different SMTP server is responsible for that) .

In such case, after your SMTP server contacts the other domain's SMTP server, and it reports an error,
your SMTP server is going to generate and send you a bounce message.

In many cases how and if errors are reported to the client is server dependent.

All this is not related to ENHANCEDSTATUSCODES extension.

ENHANCEDSTATUSCODES extension describes 3 digit codes (e.g. 2.1.0) to describe an error message.
Those are parsed out from the server's response and placed in SmtpResponse.EnhancedStatusCode propery.

Server can report errors even if it doesn't support this extension by using regular SMTP status codes (placed SmtpResponse.Code e.g. 200)

by (301k points)
...