开发者

ASP.Net Email and Account validation

开发者 https://www.devze.com 2022-12-24 07:25 出处:网络
i was wondering if any one can advise me on how i can go about im开发者_如何学Pythonplementing a email and account validation feature in my ASP.net website. so when a user creates an account, an email

i was wondering if any one can advise me on how i can go about im开发者_如何学Pythonplementing a email and account validation feature in my ASP.net website. so when a user creates an account, an email is sent to the email address used, and the user needs to verify that email address to be able to logon.

thanks


Suggested workflow..

  1. Create an account for the user in your database and mark the account as "to be validated"
  2. Produce a random key, maybe a GUID and add it to the users account
  3. Email the random key to the user along with a unique URL, e.g www.myurl.com/validateuser.aspx?userid=45532 To email using asp.net use the system.net.mail namespace - lots of bits on the internet about this.
  4. On validateuser.aspx ask user to enter key sent to them in email.
  5. Check if keys match. If so update db record to "validated"

Edit

By the way, there is a nice answer here on Stack Overflow if you are using forms auth


you can use regular expression of email id check after validation save id in database and and on button behind code of registration write code for sending email using system.net.mail

many email sending function available on internet.

after registeration using coding to check on logon either the email exists in ur database or not.


This is almost a year too late, but for the records you should use the built-in ASP.NET Membership functionality because you get all this (and much more) for free, no need to make e-mail validation logic if it's already made for you is it?

http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号