SMTP error #102 extra information

Hello. I have used the SMTPSecureSocket for years. I have been having some trouble lately with error #102, LostConnection. I understand that it could be a permanent error or a “status” from the SMTP server. My question is, if that error is returned from the server, has the attempt to send email(s) been terminated? Or, will the process continue to try and resend until it reaches my own internal timeout and I cancel it?

My second question is, if the process to send is terminated because of this error, I assume it is okay to just try to use the SendMail method again, correct?

Thanks for the help,

did you fill the headers informations of the mail you’re trying to send ?

Maybe this Thread helps: :wink:

Thanks, for the prompt replies, Guys. I have dealt off and on for error 102 for years. They just happen sometimes. My specific question is, does the SendMail method terminate and no longer attempt to connect and send the email(s) to the the SMTP server any longe after receiving this error or not? I would like to know because, if it just stops attempting to send, the I will find a way to retry sending since this error could only be a temporary status.


From the documentation

You will get this error if the remote side disconnects (whether its forcibly- by pulling their ethernet cable out of the computer), or gracefully (by calling SocketCore’s Close method). This may or not be a true error situation. If the remote side closed the connection, then it is not truly an error; it’s just a status indication. But if they pulled the ethernet cable out of the computer, then it really is an error; but the results are the same. The connection was lost. You will also get this error if you call the Disconnect method of TCPSocket.

Thanks, Tim. What happens to the attempt to send the email if the server returns this though. Does the SendMail method continue to try to send or does it terminate? I cannot find that in the documentation.


How can it do anything except terminate? The remote end will dump the transaction so far anyway. You’ll need to mark the transfer as error and retry it some other time.

I agree that is a good assumption. The behavior of the SendMail method is not well documented. What made me have this question is that it is the only one of the errors that may not really always be an error, but a “status”.