title: Can I test SmtpClient before calling client.Send()?
body: <p>This is related to a question I asked the other day on <a href="https://stackoverflow.com/questions/366629/how-do-i-send-an-email-message-from-my-c-application">how to send email</a>.   </p>
  
  <p>My new, related question is this... what if the user of my application is behind a firewall or some other reason why the line client.Send(mail) won't work...</p>
  
  <p>After the lines:</p>
  
  <pre><code>SmtpClient client = new SmtpClient("mysmtpserver.com", myportID);
  client.Credentials = new System.Net.NetworkCredential("myusername.com", "mypassword");
  </code></pre>
  
  <p>is there something I can do to test client before I try sending?  </p>
  
  <p>I thought about putting this in a try/catch loop, but I'd rather do a test and then pop up a dialog saying:  can't access smtp or something like that.  </p>
  
  <p>(I'm presuming that neither I, nor potentially my application user, has the ability to adjust their firewall settings.  For example... they install the app at work and don't have control over their internet at work)</p>
  
  <p>-Adeena</p>