Click here to Skip to main content
15,885,952 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need a coding to send email when user clicks forget password....

In my design when user clicks forget password the texbox open with submit button....Then user need to enter their email address and click submit button....

If they click submit button the email send to their id with password...

But in my coding the email not delivered to their id....

So I need coding without using session in C# for this problem ....



Pleas help me.................
Posted
Updated 2-Mar-12 2:05am
v3
Comments
Oshtri Deka 2-Mar-12 7:47am    
Can we see your code?
I assume you use SMTP, perhaps you only need to authenticate your sender.
Herman<T>.Instance 2-Mar-12 7:48am    
you know what the sideaffect is of your solution?
I can enter anyone's email address. How do you know it is me or some else?
[no name] 2-Mar-12 7:56am    
What have you tried so far? Show what you have done.

1 solution

This is a bad idea.
Digimanus is correct, I could give your system your user id, and a Ten Minute Mail email address, and you would send me your password. Then I could log in as you and do anything I wanted.

There are two (at least) problems here:
1) I could get you password without you knowing. Since people tend to use a single password for multiple systems, this is very dangerous.
2) You are storing passwords in a easily retrieveable format.

Do not do either.
Operate this way instead:
1) Store password hashes instead of text - because they cannot be decoded back to the original password, they are much more secure (they also have a fixed length, which helps with the DB design). There is a Tip here that should help: Password Storage: How to do it.[^]
2) Require your users to enter a valid email address when they register. (You can check it by sending a confirmation email which they must respond to before they continue).
3) When they forget the password, reset it to a random value, and send the new random value to the original email address.

This means that the original password is never known - except to the original user. So if he uses the same password for all his systems, then they aren't compromised either.
 
Share this answer
 
Comments
Anuja Pawar Indore 2-Mar-12 8:16am    
My 5

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