SMTPSocket generates Error...

Why does sendmail of SMTPSocket always generate an Error event?
(I’m on mac os x 10.8.5 with Xojo Release 3)

I have debug logging in all the events ConnectionEstabilshed, Error, MailSent, MessageSent, SendProgress, ServerError.

[quote]2013-09-17 10:50:43.008 AM WebApp.debug[30390]: Microsoft ESMTP MAIL Service ready at Tue, 17 Sep 2013 10:50:39 -0600
2013-09-17 10:50:43.008 AM WebApp.debug[30390]: 22 bytes sent, 0 bytes left
2013-09-17 10:50:43.032 AM WebApp.debug[30390]: 51 bytes sent, 0 bytes left
2013-09-17 10:50:43.054 AM WebApp.debug[30390]: 32 bytes sent, 0 bytes left
2013-09-17 10:50:43.076 AM WebApp.debug[30390]: 6 bytes sent, 0 bytes left
2013-09-17 10:50:43.098 AM WebApp.debug[30390]: 2115 bytes sent, 0 bytes left
2013-09-17 10:50:43.213 AM WebApp.debug[30390]: Message Sent!
2013-09-17 10:50:43.213 AM WebApp.debug[30390]: Mail Sent!
2013-09-17 10:50:43.225 AM WebApp.debug[30390]: 6 bytes sent, 0 bytes left
2013-09-17 10:50:43.248 AM WebApp.debug[30390]: Send mail error!
And yet the email is delivered.

However I have one user whose email isn’t being delivered and there is only 1 event generated and that is the Error.
No other events are generated… I don’t get it.

I think the error is generated by the underlying socket class when the socket disconnects. The way I have handled it is I subclass the smtpsocket and set a flag in mailsent that tells me to ignore the error.

This I think is true Tim.
Thanks for the reply Tim.

This is confusing to explain, but I’ll try.

On my mac i hadn’t configured dns search domains correctly.
The smtp server host name I passed to the SMTPSocket class was simply smtp, not
i.e. nslookup of smtp should fail.

So email was never sent. but… no other events were generated by the SMTPSocket class other than the Error event it always generates even when there is no error.

So I’m a little confused, on how I should handle this.

I mean sure I can set a flag that say if you haven’t received any success indication and you get the final error indication then your mail wasn’t sent… but I’m sure that that wasn’t the authors intended use of the class… specifically when there are other events that I think are intended to indicate that an actual error occurred.