Password recovery - Sending Mail

Posted by Gayathri under ASP.NET on 5/5/2011 | Points: 10 | Views : 4850 | Status : [Member] | Replies : 4
I have a project which has a forgotpassword screen.
This page will have userid ,hint question and answer.
If the answer is right , the page has to send an email to the corresponding userid.

say library@books.com to abcd@gmail.com
Please help me with exact coding.
I tried using system.net.mail but not able to proceed so becoz of unknown error.


Thanks in advance.




Responses

Posted by: Nishithraj on: 5/5/2011 [Member] Bronze | Points: 25

Up
0
Down
Why don't you try the password recovery control
http://www.asp.net/cssadapters/membership/PasswordRecovery.aspx

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gayathri on: 5/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
Thanks for your response. but i am sorry i actually want the email part in this which will send the email to user saying that this is your new password with some random generated password.

also i do not want to show the from user id and password in the coding.

most of the references i have seen clearly instructs to show the from user id and pwd in the coding.

i want to take the from user id and pwd dynamically. provided the domain alone will be @library.com
i hope my question is correct . please help.

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 5/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
If you want to Generate userid and password dynamically, you can use your own logic.
lets say you want a random string for password of a particular length,

private string GetRandomString(int length)

{
Random rndm=new Random();
var mch = Enumerable.Range(35, 2).Select(c => (char)c).Union(
Enumerable.Range(49, 9).Select(c => (char)c)).Union(
Enumerable.Range(64, 27).Select(c => (char)c)).Union(
Enumerable.Range(97, 26).Select(c => (char)c)).ToArray();

var mcstr = Enumerable.Range(1, length).Select(a => mch[rndm.Next() % mch.Length]).ToArray();
return new string(mcstr);
}
Similarly you can generate a from address then append it with domain @library.com
Thanks,
Debata

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 5/19/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

Refer this,

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

Regards,
Susan

Gayathri, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response