Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. check Email exist or not

check Email exist or not

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomhelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kavitha_blueindia
    wrote on last edited by
    #1

    Hi all, Is there any way to check whether Email exists not syntax wise.For eg:aaaaaaaaaaa@bbbbb.com. though it has valid syntax it doesn't exist in real.How to check this using asp.net code.Please help me. Thanks.

    C D 2 Replies Last reply
    0
    • K kavitha_blueindia

      Hi all, Is there any way to check whether Email exists not syntax wise.For eg:aaaaaaaaaaa@bbbbb.com. though it has valid syntax it doesn't exist in real.How to check this using asp.net code.Please help me. Thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      No, there isn't, not short of sending an email and seeing if it bounces, but that's not 100%, and it's user intrusive.

      Christian Graus Driven to the arms of OSX by Vista.

      T 1 Reply Last reply
      0
      • C Christian Graus

        No, there isn't, not short of sending an email and seeing if it bounces, but that's not 100%, and it's user intrusive.

        Christian Graus Driven to the arms of OSX by Vista.

        T Offline
        T Offline
        Tamer Oz
        wrote on last edited by
        #3

        There is no 100% guranteed way but you can check mx records. Try the following code it may give an idea. public class MailValidator { private bool mResult = false; public bool Result { get { return mResult; } set { mResult = value; } } private string mError = ""; public string Error { get { return mError; } set { mError = value; } } private string mMailAddress = ""; public string MailAddress { get { return mMailAddress; } set { mMailAddress = value; } } public MailValidator(string mailAddress) { mMailAddress = mailAddress; } public bool MailExists() { string domainName = mMailAddress.Substring(mMailAddress.IndexOf("@") + 1); foreach (string str in Mx.GetMXRecords(domainName)) { TcpClient insTcpClient=null; try { //MessageBox.Show(str); insTcpClient = new TcpClient(str, 25); NetworkStream ns = insTcpClient.GetStream(); byte[] recievedMessage = new byte[insTcpClient.ReceiveBufferSize]; ns.Read(recievedMessage, 0, insTcpClient.ReceiveBufferSize); //MessageBox.Show(Encoding.ASCII.GetString(recievedMessage)); string messageToSend = "HELO\r\n"; byte[] buffer = System.Text.Encoding.GetEncoding(1254).GetBytes(messageToSend); ns.Write(buffer, 0, buffer.Length); recievedMessage = new byte[insTcpClient.ReceiveBufferSize]; ns.Read(recievedMessage, 0, insTcpClient.ReceiveBufferSize); //MessageBox.Show(Encoding.ASCII.GetString(recievedMessage)); messageToSend = "MAIL FROM:<deneme@" + domainName + ">\r\n"; buffer = System.Text.Encoding.GetEncoding(1254).GetBytes(messageToSend); ns.Write(buffer, 0, buffer.Length); recievedMessage = new byte[insTcpClient.ReceiveBufferSize]; ns.Read(recievedMessage, 0, insTcpClient.ReceiveBufferSize); //MessageBox.Show(Encoding.ASCII.GetString(recievedMessage)); messageToSend = "RCPT TO:<" + mMailAddress + ">\r\n"; buffer = Syst

        1 Reply Last reply
        0
        • K kavitha_blueindia

          Hi all, Is there any way to check whether Email exists not syntax wise.For eg:aaaaaaaaaaa@bbbbb.com. though it has valid syntax it doesn't exist in real.How to check this using asp.net code.Please help me. Thanks.

          D Offline
          D Offline
          David Mujica
          wrote on last edited by
          #4

          Check this site out ... http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=22[^] I played around with it and it seemed to work very well. I don't know how they validate the email address, but it seems to work. I've also played around with their stock-quote webservice, which works very nicely. Give it a shot.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups