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
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to check that the provided e-mailid is valid or not?

How to check that the provided e-mailid is valid or not?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
7 Posts 7 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.
  • S Offline
    S Offline
    Subin Alex
    wrote on last edited by
    #1

    Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

    B B P C J 6 Replies Last reply
    0
    • S Subin Alex

      Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

      B Offline
      B Offline
      binarymax
      wrote on last edited by
      #2

      Hi, I think you should definitely use a regular expression. A quick google search for "valid email regular expression" leads to a good example here: http://www.codetoad.com/asp_email_reg_exp.asp[^] That source is in the older ASP (not .NET), but the function should still work. --EDIT -- actually you'll need to change around the function a bit but you get the idea.

      1 Reply Last reply
      0
      • S Subin Alex

        Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

        B Offline
        B Offline
        Baran M
        wrote on last edited by
        #3

        Use this free web service and check email address Email Validation[^]

        1 Reply Last reply
        0
        • S Subin Alex

          Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          //java script function isValidEmailID(emailid) { var regex = new RegExp("\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); var matches = regex.exec(emailid); return (matches != null && emailid == matches[0]); } //aspx.cs email = txtEmail.Text.Trim(); if (!IsValidEmail(email)) { custVal.ErrorMessage = "Valid EmailID : Must be Entered"; custVal.IsValid = false; return; }

          Padmanabhan

          1 Reply Last reply
          0
          • S Subin Alex

            Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

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

            You can't, actually. There is no way of doing this. You can tell if an email address is possible, but not if it's real.

            Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

            1 Reply Last reply
            0
            • S Subin Alex

              Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

              J Offline
              J Offline
              Jorgen Andersson
              wrote on last edited by
              #6

              There is no way to know for sure, but you're close if you connect to the users smtpserver to find out if it accepts mail to the recipient. Here's[^] how to do it.

              1 Reply Last reply
              0
              • S Subin Alex

                Hi, I am new to asp.net,I would like to know if a user enters his e-mailid in my form, How to check whether it is fake or not? Plz help.

                F Offline
                F Offline
                farogh haider
                wrote on last edited by
                #7

                Hi, You can check email format by using validation & if you want to check it is exist or not then you should use any webservice or free dll.

                Farogh Haider Web developer

                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