Re: tidSmtp "state machine" question

Giganews Newsgroups
Subject: Re: tidSmtp "state machine" question
Posted by:  Don (kingfi…
Date: Mon, 16 Jan 2006

> I have a problem with tidsmp, or more exactly, with "how to
> find out what went wrong during the transmission of mail."

> A SMTP session is a state machine: several steps are performed
> sequentially until a mail is sent. During each step errors may
> occur.

> AFAIK, tidsmtp only gives me the possibilities to call the "send" method,
> and to query the "lastcmdresult" property if anything goes wrong.
> The point is, I don't know WHERE in the state machine the error
> occurred.

The exactly nature of the error should be indicated in the resulting
exception.  Because some errors require calling Reset for the session,
LastCmdResult may not always contain the full or correct information.  IOW,
LastCmdResult may contain the result code form the Reset command and not the
original error.

The message for any exception should tell you the server response in the
protocol exchange that signifies a problem. If you call Send or QuickSend,
an EIdSMTPReplyError should tell you the details for the failed message.
Any exception generally indicates that the message was not successfully

If the problem is one recipient (out of several), the OnFailedRecipient
event handler could/should be used to determine how you'd like that
recipient to be handled.

> Was it a response to "MAIL FROM"?
> Was it a response to one of the "RCPT TO" commands?
> Or was the error generated *after* the mail was transmitted, something
> like "mail quota exceeded" or "we accept no spam"?

These items and their error response codes are detailed in the RFCs for

RFC 821 - Simple Mail Transfer Protocol
RFC 1869 - SMTP Service Extensions
RFC 2197 - SMTP Service Extension for Command Pipelining
RFC 2554 - SMTP Service Extension for Authentication

But in general... if there was no exception then there was no problem.




In response to

tidSmtp "state machine" question posted by arthur hoornweg on Mon, 16 Jan 2006