Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 20th, 2010, 07: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


Similar Threads
Thread Thread Starter Forum Replies Last Post
password recovery message kevin33 Wrox Book Feedback 5 November 14th, 2008 05: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 05: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.