by
cnwrca1 >> Mon, 27 May 2002 5:28:33 GMT
The documentation does not distinguish between validation that occurs before the message is sent, and validation that occurs during transmission.
If validation fails before the message is even sent (for example, because you forgot to set the sendFrom property), you will get a CnSmtpConnectionException, but you will not get a completion notification.
If validation fails during transmission (for example, because an allegedly ASCII attachment is found to contain non-ASCII characters), you will get a CnSmtpConnectionException, and also a completion notification.
In the latter case, a dialogue has already been established with the mail server, and the CnSmtpConnection object has to abort the dialogue according to the rules of the protocol. In the former case, no dialogue has been established.
The original thinking was that completion notification is only applicable once the transmission has started, but I agree that it would be more symmetrical if it applied in both cases.
Is there something extra I need to do to raise the exception for the error?
You could cause the completion event yourself in your exception handler:
exObj.mySmtpConnection.causeEvent(CnSmtpConnection.Completion_Event_Type, true, null);
where exObj is an exception of type CnSmtpConnectionException.
If you need more help, please contact me directly at
rarzoni@jade.co.nz .
Regards,
Robin