To ensure that the server is up you can establish connection with it on port
25. There is a class TcpClient in the .NET Framework. If the server is okay
the first word in the response from it will be code 220 for more details
consult the smtp rfc.
the code to perform connection
TcpClient tcpClient = new TcpClient ();
tcpClient.Connect ("smtp.server.name", 25);
then read the response and check for the status code...
--
Vadym Stetsyak aka Vadmyst
"Ben Fidge" <be*******@btopenworld.com> wrote in message
news:eO**************@TK2MSFTNGP10.phx.gbl...
Hi
I'm working on a project where some business process rely on several
external servers to perform processing. These are Sql Server x 2, Credit
Card processing and Mail Server.
Before entering the business process, I'd like to verify that each of
these are available, in particular the SMTP Server, which is the most volatile
of the above servers. What would be the best way to detect if the SMTP server
is up and running?
Ben