1 Reply Latest reply: Dec 19, 2007 10:55 PM by 796440 RSS

    How to ping mail server in sent mail ?

    807603
      in my send mail code if my mail server is invalid then it throws SocketException if i want to ping mail server before i sent email how can i do that if i want avoid this SocketException
        • 1. Re: How to ping mail server in sent mail ?
          796440
          AmitChalwade123456 wrote:
          in my send mail code if my mail server is invalid then it throws SocketException if i want to ping mail server before i sent email how can i do that if i want avoid this SocketException
          There's no point in doing that. Even if it responds to the ping, it may go down between the ping and sending the mail. Or it may respond to the ping, meaning the box is up, but the mail service may still be down.

          Whether it comes from a failed ping or from an exception, the end result is the same: You can't send mail to that server right now.

          Just catch the exception and handle it. Don't overcomplicate things for no gain.