using password recovery control connect to memershiprovider and send password as email

hi,

 this is my first question in this forum and its urgent -please help.

 

I am new to asp.net 2.0 and I am supposed to create a web page using password recovery control and and when the user enters a user id -(which in my application is an email id) I should connect to the Membership provider that I created in web.config and then retreive the password from database and using smtp mail server I should email that password to that user's email.

 

how do i acheive it- I saw lot of examples but they r not clear- please can anyone give me a live example of how this is done.

 

thanks in advance

regards

pivi

 

0
pivi
12/7/2005 9:52:09 PM
asp.net.security 27051 articles. 1 followers. Follow

4 Replies
1018 Views

Similar Articles

[PageSpeed] 35
Get it on Google Play
Get it on Apple App Store

If you are not creating your own membership provider, you don't need do anything, just put the password recovery control to your page, and it will work. But you said "Membership provider that I created", if you have your own provider, you just need make sure you defined all the functions.

Don't forget add the smtp setting in your web.config.

 

0
wyx2000
12/8/2005 1:29:03 AM

Hi,

  thanks a lot,

  actually these are my settings for MembershipProvider and my smtp settings - but how do I add them into the password recovery control so that it reads these values

web.config file

<System.web>

<membership defaultProvider="AMembershipProvider">

<providers>

<clear/>

<add name="AMembershipProvider" type="AMembershipProvider.AMembershipProvider, AProviders"

connectionStringName="MySqlProviderConnection" enablePasswordRetrieval="false"

enablePasswordReset="true" requiresQuestionAndAnswer="true"

applicationName="/" requiresUniqueEmail="true"

maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"/>

</providers>

</membership>

</system.web>

<system.net>

<mailSettings>

<smtp>

<network host="smtphost" from="pivi@yahoo.com" port="25" userName="pivi" password="junk" defaultCredentials="true"/>

</smtp>

</mailSettings>

</system.net>

 

and my password recovery control is:

<asp:passwordrecovery id="PasswordRecovery1" runat="server" MembershipProvider="AMembershipProvider" SubmitButtonText="Send My Password" UserNameInstructionText="">

<MailDefinition From="pivi@yahoo.com" Subject="Password Recovery">

</MailDefinition>

</asp:passwordrecovery>

 

my question is - is this code sufficient to retrieve the password and mail it to a respective email address that is pulled from the database using membership provider - cos this is real time data that I am talking about and I dont know what else to do- this is all the code I wrote so far. what did u mean by writing membership functionality???????  please help...

 

thanks in advance

pivi

0
pivi
12/8/2005 3:03:29 PM

Hi,

  thanks a lot,

  actually these are my settings for MembershipProvider and my smtp settings - but how do I add them into the password recovery control so that it reads these values

web.config file

<System.web>

<membership defaultProvider="AMembershipProvider">

<providers>

<clear/>

<add name="AMembershipProvider" type="AMembershipProvider.AMembershipProvider, AProviders"

connectionStringName="MySqlProviderConnection" enablePasswordRetrieval="false"

enablePasswordReset="true" requiresQuestionAndAnswer="true"

applicationName="/" requiresUniqueEmail="true"

maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"/>

</providers>

</membership>

</system.web>

<system.net>

<mailSettings>

<smtp>

<network host="smtphost" from="pivi@yahoo.com" port="25" userName="pivi" password="junk" defaultCredentials="true"/>

</smtp>

</mailSettings>

</system.net>

 

and my password recovery control is:

<asp:passwordrecovery id="PasswordRecovery1" runat="server" MembershipProvider="AMembershipProvider" SubmitButtonText="Send My Password" UserNameInstructionText="">

<MailDefinition From="pivi@yahoo.com" Subject="Password Recovery">

</MailDefinition>

</asp:passwordrecovery>

 

my question is - is this code sufficient to retrieve the password and mail it to a respective email address that is pulled from the database using membership provider - cos this is real time data that I am talking about and I dont know what else to do- this is all the code I wrote so far. membership functionality is already written by another developer in my company and she says we just need to call the membership provider and that should be good...  please help...

 

thanks in advance

pivi

0
pivi
12/8/2005 3:29:39 PM

As I said, once you put necessory settings in web.config, you just need drop a passwordrecovery control on your page and it will work.

So far you didn't tell me what issue you have, did you try it or not? sounds like it doesn't work for you. What error you get if that is the case?

 

 

0
wyx2000
12/8/2005 8:06:40 PM
Reply:

Similar Artilces:

How not to use security question and password in the Password Recovery control?
How not to use security question and password in the Password Recovery control? Thanks. You can turn in off in your web.config by setting the Membership provider's requiresQuestionAndAnswer attribute to false. You can for example update the membership in the machine.config or add a new provider to your web.config.  <membership>            <providers>                <add name="AspNetSqlMembershipProvider"      &...

Unable to use Password Recovery control to send email with Gamil SMTP.
I need to send the password recovery email using SMTP server of Gmail. Since, Gmail requires enableSsl to be set to true, I can't set the mail settigs in web.config like :- <system.net>    <mailSettings>      <smtp from="usernme@gmail.com">        <network host="smtp.gmail.com" port="587" userName="username" password="mypassword" defaultCredentials="false"></network>      </smtp>  &nb...

How to enable SSL for smtpclient when use Password Recovery control to send email
 I can send email with secure connection (SSL) in my program;  Web.config: <system.net>  <mailSettings>   <smtp from="fromaddress">    <network host="smtphm.sympatico.ca" password="password" userName="username" />   </smtp>  </mailSettings> </system.net> ----------------------------------     Protected Sub SendEmail()        '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS  &nbs...

How to use Forgot Password and Password Recovery Control
I want a basic functionality of Forgot Password. Like user enters his username and user should get a link where user can change his new password and i dont want the user to put old password. Just enter new password and submit and user's new password got saved in system. Also on clicking of Forgot Password Button how to send a mail and how to design the link i mean in what format , that we need to send to user in email. Thirdly i just tried to send a simple mail on click of forgot password button from my local development machine. My machine does not have any outlook or mail server set...

Problem in sending new password by password recovery control
Password recovery control gives me a message that a new password has been sent but when i open my inbox i find no messages, i have tried alternative email accounts but it dosen't work. Hi Make sure you have config the SMTP server and it sends email with out problem. <system.net> <mailSettings> <smtp from=test@company.com> <network host="smtpserver1" port="25" userName="username" password="secret" defaultCredentials="true" /> </smtp&...

How to force Password Recovery control to send new password to user?
I have a strange situation.  When first creating my app, I originally didn't require my test users to enter a security Question and Answer.  I now see the necessity for these and have made the necessary changes in web.config.But here's the catch: If such a user tries to use the Password Recovery mechanism, it fails because there is no question and answer.  So I'm wondering if there's a way for me to force the PasswordRecovery control to reset the user's password and send the appropriate e-mail?Robert Robert WernerVancouver, BCwww.mwtech.blogspot.comwww.pock...

Password recovery control and reset Password and sending a token link
Hey Can Anyone please direct me to a good example on how to achieve the following:When a user use the password recovery control, I  would like the email to send the person a token link to a page which he/she follows and where he/she can type in a new password...(something like the amazon.com and also www.Asp.net (this website) approach)I rather want to use the above method instead of the usual 'new reset password' that you get in the email. I dont want to send any passwords in the email not even a new reset password.I would appreciate any advise on this matterThank you so much :...

Password recovery showing the password in the page rather than sending the email?
Hi guys, I would like to enquire about the password recovery. Can i get the password to appear in the page itself rather than sending email to the user? Please help me. Thank you in advance.  Hi,Depending on the membership settings.If you allowed password retrieval("enablePasswordRetrieval" set to true) and if you set the password format to clear ("passwordFormat" set to true) , then you can simply get the user password using this code : string pwd = Membership.GetUser("User Name here").GetPassword(); However , the mentioned code will fail if t...

Password Recovery control
Hi,I am using the Password Recovery control and have given all my users my email address at work and everything works fine.  As soon as I give them another email address eg. a Yahoo address, then I get the following error message - SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for xyz@yahoo.com I would appreciate any help.  Many thanks in advance.Polly Anna That could means your outgoing e-mail server requires authentication.Cheers,       Kevin JonesMy Blog Thank you ...

Password, Password, Password
How can I login once per session and not have to reenter my root password every time I open YaST, etc. I believe in good security so I use strong passwords and I am also new to Linux which requires a lot of toying around so I have to enter my password over and over every session. -- OpenSourceRules ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You could setup sudoers so you could call 'sudo /path/to/application' and have that NOT prompt you for a password. 'man sudoers' for more...

How to send default password when user forgot his possword by using password recovory control..?
HI if user forgots his password in my page there is password recovery control (asp.net control) whn user enter his username and his security answer, then in sending mail() method i resetting the user password by using ChangePassword(security_answer,"default_password") and send i sending a mail to user with this "default password " to login to the system. This works fine . and membership. password recovery control once again sends another mail to user with random password to the user. but if the user logs in with this random password it is not working and only the user c...

Not able to send mail using password recovery control
 Hi,I'm using password recovery control to email my password to the email address stored in the system. But the control is unable to send email from my gmail account since SSL is enabled in gmail. So I tried setting up my own text file in custom format to send a message via SMTP. But I do not know how to retrieve the system generated password which gets automatically created when the user clicks the submit button. How do I get the value of this field and send via SMTP to my email? Thanks   do you try to configure the SMTP setting in your ASP.NET Configuration page ? On...

Password Recovery Control
Hi;I spent a lot of time looking for an answer on gloogle and here but everything i found didn't work for me.(I'm using VS 2005) I created a page with a PasswordRecovery control but everytime i put the username and click on the  button, i get this error: Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts Here are the settings from my web.config: <system.net>  <mailSettings>     <smtp deliveryMethod="Network" from="info@mysite.com">     <network &n...

Sending Recovery Password Email From Recovery Wizard.
I am trying to give the option to send an email to users who forgot their passwords. My smpt setting are defined in the Web.Config File     <add key="smtp_email" value="smtp.sbcglobal.yahoo.com"/>    <add key="smtp_email_username" value="myvalue/>    <add key="smtp_email_password" value="mypassword"/>    <add key="smtp_port" value="25"/> what should the code look like from the VB or C# on the code behind page in the send mail event ...

Web resources about - using password recovery control connect to memershiprovider and send password as email - asp.net.security

Resources last updated: 11/25/2015 10:51:57 AM