6 aprilie 2006 10:52
I have an application in C#, that is depending on the fact that a smtp-server is valid and running.
Is there any way of checking if a given smtp-server is "alive"?
SmtpClient smtpclient = New SmtpClient(<server>);
6 aprilie 2006 11:18ModeratorYou can try to handshake with the Smtp server, it the handshake could be done everything is running normally.
Take a look at the Smtp protocol how to implement an handshake or take a look at the following article that demostrates how to then email with C#. It implements all commands and you can just pickout the handshake process: Sending email with c# using SMTP Servers.
6 aprilie 2006 12:35
The following solved it:
public bool Handshake()
TcpClient tcp = New TcpClient();
Catch (Exception myException)