Click here to Skip to main content
16,004,574 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hii
myself somendra chaudhary
i am developing a social networking site.
i want to know about a functionality in which
website automatically sent a mail to user's email
id ,that mail contain a link, on clicking that link
user redirect to website and become a legal user.
i want to know about logic behind this and coding also.
please reply soon.
Thank you
Posted
Comments
ambujs 2-Oct-10 3:17am    
plz tell me how to send email to mobile as mobile confirmation technique as in waytosms.com

Here is the logic you might use:

1. Add two columns ActivationKey (varchar or uniqueidentifier) and Active (bit) in the user table, if some similar columns doesn't exist already.

2. When user is registered, before sending an email, generate a GUID and update the user data with setting the ActivationKey field with the newly generated GUID and setting the Active field to false in the corresponding user table.

3. Generate the link with adding the ActivationKey (GUID) as a Query string parameter.

4. When user clicks the URL link in the email, retrieve the user using the ActivationKey (GUID) from the user table. If no user is available with the ActivationKey, show an error message.

5. If user is available with the ActivationKey, and if user is already activated (Active = true), show message that the user has already been activated. Otherwise, (If Active = false) set Active = true and show success message that user has been activated.

Based upon the above logic, I hope it would be easy for you to implement the main functionality.
 
Share this answer
 
You may need a sign-up process to collect user data. Save each user into database with a unique ID and then send out an email. The link in the mail would have the ID as a parameter. When the link is clicked, you page will grab this ID and compare it with you database to confirm the user and let him in. In this process, encryption and expiration of the ID may have to be considered for security purpose.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900