ASP.Net Email and Account validation
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..
- Create an account for the user in your database and mark the account as "to be validated"
- Produce a random key, maybe a GUID and add it to the users account
- 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.
- On validateuser.aspx ask user to enter key sent to them in email.
- 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
精彩评论