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

Re: Detecting if SMTP server is running by Vadym

Vadym
Mon Sep 05 06:06:48 CDT 2005

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" <ben.fidge@btopenworld.com> wrote in message
news:eORl13fsFHA.1444@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
>
>
>



Re: Detecting if SMTP server is running by Ben

Ben
Mon Sep 05 06:16:28 CDT 2005

Excellent. Thanks for the response. I'll give it a go.

Regards



"Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
news:e4vw7ngsFHA.3732@TK2MSFTNGP11.phx.gbl...
> 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" <ben.fidge@btopenworld.com> wrote in message
> news:eORl13fsFHA.1444@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
>>
>>
>>
>
>