title: How to check an email address exists?
body: <p>I am trying to check whether an email address exists, or not. I can verify <code>@gmail.com</code> addresses against the SMTP server <code>gmail-smtp-in.l.google.com</code>, but I do not know how to get the SMTP server for other domains, to check against. Please advise how to get the SMTP server of a domain, or alternatively another way to reliably check if email addresses exist.</p>
  
  <p>This is my code to check <code>@gmail.com</code> addresses:</p>
  
  <pre><code>TcpClient tClient = new TcpClient("gmail-smtp-in.l.google.com", 25);'
  string CRLF = "\r\n";
  byte[] dataBuffer;
  string ResponseString;
  
  NetworkStream netStream = tClient.GetStream();
  StreamReader reader = new StreamReader(netStream);
  ResponseString = reader.ReadLine();
  
  /* Perform HELO to SMTP Server and get Response */
  dataBuffer = BytesFromString("HELO AnkurHere" + CRLF);
  netStream.Write(dataBuffer, 0, dataBuffer.Length);
  ResponseString = reader.ReadLine();
  
  dataBuffer = BytesFromString("MAIL FROM:&lt;abc@gmail.com&gt;" + CRLF);
  netStream.Write(dataBuffer, 0, dataBuffer.Length);
  ResponseString = reader.ReadLine();
  
  /* Read Response of the RCPT TO Message to know from google if it exist or not */
  dataBuffer = BytesFromString("RCPT TO:&lt;" + TextBox1.Text.Trim() + "&gt;" + CRLF);
  netStream.Write(dataBuffer, 0, dataBuffer.Length);
  
  ResponseString = reader.ReadLine();
  if (GetResponseCode(ResponseString) == 550)
     {
         label1.Text = "Mai Address Does not Exist !";
         label2.Text = "Original Error from Smtp Server" + ResponseString;
     }
  
  /* QUITE CONNECTION */
  dataBuffer = BytesFromString("QUITE" + CRLF);
  netStream.Write(dataBuffer, 0, dataBuffer.Length);
  tClient.Close();
  </code></pre>