4 Replies - 730 Views - Last Post: 25 March 2018 - 10:14 PM Rate Topic: -----

#1 seniorCSGuy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 02-March 18

how to check the email entered by the user on a form exists ASP.NET

Posted 25 March 2018 - 02:11 PM

Is there a way to check if the email entered by the user on a web form exists? I can check if the format is valid but not if the email actually exists.
Is This A Good Question/Topic? 0
  • +

Replies To: how to check the email entered by the user on a form exists ASP.NET

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14691
  • View blog
  • Posts: 58,719
  • Joined: 12-June 08

Re: how to check the email entered by the user on a form exists ASP.NET

Posted 25 March 2018 - 02:56 PM

Exists in a database, or exists where/
Was This Post Helpful? 0
  • +
  • -

#3 seniorCSGuy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 02-March 18

Re: how to check the email entered by the user on a form exists ASP.NET

Posted 25 March 2018 - 04:23 PM

View Postmodi123_1, on 25 March 2018 - 02:56 PM, said:

Exists in a database, or exists where/


Exits in general
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14691
  • View blog
  • Posts: 58,719
  • Joined: 12-June 08

Re: how to check the email entered by the user on a form exists ASP.NET

Posted 25 March 2018 - 09:39 PM

That doesn't explain what you mean.
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11376
  • View blog
  • Posts: 19,410
  • Joined: 19-March 11

Re: how to check the email entered by the user on a form exists ASP.NET

Posted 25 March 2018 - 10:14 PM

You want to know if the email address [email protected] is actually an account that can receive mail? Good luck. No responsible server in 2018 is going to give you that information. In 1988, sure, you could finger that account and bob's your uncle, you've got your answer, but a few things have happened since then.
Your only option is to send an email to the account asking them to hit a verification link. This works if the user has some incentive to cooperate (for example, if they're creating an identity on your site). Typical strategy is to hash the user ID and use that as the token that they hand back to you. This is the sort of thing that responsible web frameworks provide either as core or as user-contributed functionality. If you write it yourself (for example, to learn how its done) for pete's sake don't deploy your version - user auth is not a good place to have NIH code.

If you want to know whether some input user_email is a legitimate email address, you have two choices. One is to find some library that validates that stuff for you - this is what we do in the real world. Nobody writes their own validation, because existing libraries are better than home-rolled. However, if you're trying to understand how validation works, you'll want to write a validator. This would be a function that takes an input and returns a boolean value if the input passes your tests. What tests? Well, there are RFCs that standardize what an email address looks like, you'd probably start there. Again, though - if you do write this for whatever reason please don't deploy it. If your framework doesn't provide it, get a proper framework.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1