Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 3.5 Security, Membership, and Role Management ISBN: 978-0-470-37930-1
This is the forum to discuss the Wrox book Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB by Bilal Haidar; ISBN: 9780470379301
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 Security, Membership, and Role Management ISBN: 978-0-470-37930-1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 20th, 2010, 06:10 AM
Registered User
 
Join Date: Feb 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with password recovery control

Hello,

Having typed the code out about tha passsword recovery control and I get the following error.
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. 14sm672265ewy.3

please any help i will be faithful..

my code as follows in aspx file:
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server" OnSendingMail="PasswordRecovery1_SendingMail" >
<MailDefinition BodyFileName="~/EmailTemplate/PasswordRecovery.txt"
Subject="your password has been reset..." From="temn.cis.just@gmail.com"
Priority="High">

the code that i include it in the web config:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="myUserName@gmail.com ">
<network host="smtp.gmail.com" port="587" userName="MyUserNamer@gmail.com" password="Mypassword" defaultCredentials="true"/>
</smtp>
</mailSettings>
</system.net>

and the code that included in the aspx.cs file is:


protected void Page_Load(object sender, EventArgs e)
{
MailMessage myMessage = new MailMessage();
SmtpClient mySmtpClient = new SmtpClient();
myMessage.To.Add(new MailAddress("MyUserName@gmail.com"));
mySmtpClient.Port = 587;
mySmtpClient.Credentials = new System.Net.NetworkCredential("MyUserName@gmail.com ", "MyPassword");
mySmtpClient.EnableSsl = true;
mySmtpClient.Send(myMessage);
}

protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
SmtpClient mySmtpClient = new SmtpClient();
mySmtpClient.EnableSsl = true;
mySmtpClient.Send(e.Message);
e.Cancel = true;
}


the text that i include it in the PasswordRecovery.txt is:
Your password has been reset, <%UserName%>!
According to our records, you have requested that your password be reset.
Your new password is: <%Password%>
If you have any questions or trouble logging on please contact a site administrator.
Thank you!

to give that user random password and user name to get log in again....
cheers
i will be faithful please any help i need it

ghader
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
password recovery message kevin33 Wrox Book Feedback 5 November 14th, 2008 04:44 PM
recovery password Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 10th, 2008 04:39 PM
Profiles and Password Recovery Control Sheraz Khan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 October 8th, 2007 03:46 PM
Loading Password into Login Control amatytfc ASP.NET 2.0 Basics 5 July 2nd, 2007 09:00 AM



All times are GMT -4. The time now is 04:30 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.