How to check if remote SMTP is working


I have been using ‘Blat’ command line utility as a SMTP client and it works well.
However, in case SMTP server is not working, my Blat shell receives a below error and the related console application stops. I am not sure why it stops.

'2019-06-18 10:01:31 : ERROR: SendEmail / shell_result: Blat v3.2.19 (build : Nov 18 2017 03:14:35) 32-bit Windows, Full, Unicode
'Error: Can't connect to server (timed out if winsock.dll error 10060)

So, as a workaround, I have been considering to have codes which check the SMTP server availability in advance before the shell issues the real Blat command.

Could you let me know if there is any way with a Xojo code?

Stop trying to roll your own, use the well tested classes provided and process the error events provided.

Yes, you are right. I found SMTPSocket.Connect method and am able to check if it is successful or not.

Thank you !