Validate and account by E-Mail

Last post 05-17-2008 5:25 AM by Mikesdotnetting. 1 replies.

Sort Posts:

  • Validate and account by E-Mail

    05-16-2008, 4:56 PM
    • Loading...
    • e.zer0
    • Joined on 03-27-2008, 3:56 PM
    • Posts 54

    Does anyone have any good links/tutorials which explain how I can validate a user by sending them an e-mail in which they recieve and click a link which in turn brings them back to my site and validates the account?

  • Re: Validate and account by E-Mail

    05-17-2008, 5:25 AM
    Answer

    This is quite straightforward. Generally the steps are as follows:

    1. Create a registration form
    2. Add a new user record when the form is submitted
    3. Obtain the newly created ID of the user (http://www.mikesdotnetting.com/Article.aspx?ArticleID=54)
    4. Generate a URL with the ID as a querystring value (eg http://www.mysite.com/VerifyUser.aspx?ID=12345 - where 12345 is the newly added ID)
    5. Generate an email and send it to the submitted email address of the new user asking them to click the link to confirm their details
    6. In VerifyUser.aspx, get the QueryString("ID") value, and update the record to show they have verified (UPDATE Users Set Verified = true WHERE UserID = @UserID)

    Job done.

    Depending on how secure you want the app to be, you might generate a random value, such as a GUID, and pass that into the link URL querystring as well.  You can check the value of that too.

     

    Regards Mike
    [MVP - ASP/ASP.NET]
Page 1 of 1 (2 items)