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. General Programming
  3. C#
  4. validate an email address

validate an email address

Scheduled Pinned Locked Moved C#
question
10 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.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    how can I validate if the email address provided by the user does exists or not before proceeding to send an email using SmtpClient?

    M 0 2 Replies Last reply
    0
    • J Jassim Rahma

      how can I validate if the email address provided by the user does exists or not before proceeding to send an email using SmtpClient?

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      jrahma wrote:

      before proceeding to send an email using SmtpClient

      You can not!!!

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      J 1 Reply Last reply
      0
      • M Manas Bhardwaj

        jrahma wrote:

        before proceeding to send an email using SmtpClient

        You can not!!!

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        so you mean there is not way to send whatever call or (ping!) to the email to verify if the email was correct or it's just a fake email?

        M 1 Reply Last reply
        0
        • J Jassim Rahma

          so you mean there is not way to send whatever call or (ping!) to the email to verify if the email was correct or it's just a fake email?

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          Untill and unless you do not send the email, you can not. But, why would you do this? This is usually done by spammers to get hold of actual email addresses :doh:

          Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          J 1 Reply Last reply
          0
          • M Manas Bhardwaj

            Untill and unless you do not send the email, you can not. But, why would you do this? This is usually done by spammers to get hold of actual email addresses :doh:

            Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

            J Offline
            J Offline
            Jassim Rahma
            wrote on last edited by
            #5

            because I have a feedback form and I want to make sure the email was correct in order to reply yo the user and to avoid people sending me junk emails using fake addresses.. so what's the solution?

            P N D M 4 Replies Last reply
            0
            • J Jassim Rahma

              because I have a feedback form and I want to make sure the email was correct in order to reply yo the user and to avoid people sending me junk emails using fake addresses.. so what's the solution?

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              jrahma wrote:

              so what's the solution?

              If you can come up with a reliable method to do this, you'll become very, very rich. There's currently no foolproof way to do this.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              1 Reply Last reply
              0
              • J Jassim Rahma

                because I have a feedback form and I want to make sure the email was correct in order to reply yo the user and to avoid people sending me junk emails using fake addresses.. so what's the solution?

                N Offline
                N Offline
                Not Active
                wrote on last edited by
                #7

                As he has been saying there is no way to verify an email address is valid unless you send a message. Most applications rely on the user to provide a correct email and warn them if the email is not correct they will not get any messages. Other ways to eliminate potential fake emails is to send a confirmation and only active the email if the user responds. You can remove any email addresses that have not been responded to in a certain time period.


                only two letters away from being an asset

                1 Reply Last reply
                0
                • J Jassim Rahma

                  because I have a feedback form and I want to make sure the email was correct in order to reply yo the user and to avoid people sending me junk emails using fake addresses.. so what's the solution?

                  D Offline
                  D Offline
                  DaveyM69
                  wrote on last edited by
                  #8

                  IIRC (it was a long time ago) the best I was ever able to come up with was to validate the email address with regex and do a look up for the MX records of the domain of the email address. This won't ensure the email address exists - daveym69[at]microsoft.com would pass (don't want spam bots hitting MS mail servers hence the [at]!), but at least you know it's properly formed and the domain actually has a mail server.

                  Dave
                  Generic BackgroundWorker - My latest article!
                  BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                  Why are you using VB6? Do you hate yourself? (Christian Graus)

                  1 Reply Last reply
                  0
                  • J Jassim Rahma

                    how can I validate if the email address provided by the user does exists or not before proceeding to send an email using SmtpClient?

                    0 Offline
                    0 Offline
                    0x3c0
                    wrote on last edited by
                    #9

                    I might be mistaken, but I think there's something in the SMTP protocol which allows this. If you're feeling particularly masochistic you could implement this. I think it works in a similar way to POP - that is, text based requests and responses.

                    OSDev

                    1 Reply Last reply
                    0
                    • J Jassim Rahma

                      because I have a feedback form and I want to make sure the email was correct in order to reply yo the user and to avoid people sending me junk emails using fake addresses.. so what's the solution?

                      M Offline
                      M Offline
                      MarkB777
                      wrote on last edited by
                      #10

                      Hi there, Have a look into CAPTCHA's. If you don't like this, another option to add a hidden textbox. Spam bots will generally fill in every box on the page (hidden or not) and then submit the form. All you have to do is check that the hidden box is empty - if not, it is a non-human user. Cheers,

                      Mark Brock "We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen

                      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