title: Validate email address on exchange server
body: <p>I'm allowing users to manage a distribution list stored in a database. Users are only allowed to enter emails that are @mydomain.com. A web based application then takes the distribution list and sends emails. I'd like to validate that the email is valid before sending an email from the application.</p>
  
  <p>To send an email I'm using this code: </p>
  
  <pre><code>    Dim SendTo As String = "ThisIsNotARealEmailAddress@mydomain.com"
      Dim SentFrom As String = "me@mydomain.com"
      Dim MessageBody As String = "blah blah blah"
      Dim MessageSubject As String = "This is the subject"
  
  
      Dim mm As New MailMessage(SentFrom, SendTo)
      mm.Subject = MessageSubject
      mm.IsBodyHtml = False
      mm.Priority = MailPriority.High
      mm.Body = MessageBody
  
      Dim smtp As New SmtpClient()
      smtp.Send(mm)
  </code></pre>
  
  <p>If the SendTo is not a valid email address the server returns this error:</p>
  
  <pre><code>Mailbox unavailable. The server response was: 5.1.1 &lt;ThisIsNotARealEmailAddress@mydomain.com&gt;... User unknown
  </code></pre>
  
  <p>Is there anyway to validate the email when the email address is added to the database, instead of a <code>try catch</code> block when sending the email?</p>