Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
 
Old February 20th, 2010, 07:19 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
ghadeer
 
Old February 22nd, 2010, 06:32 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Maybe this helps? http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=505

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 23rd, 2010, 04:33 PM
Registered User
 
Join Date: Feb 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanx

thank you very much it really work perfectly....my error was too small..
but i learn it
re thank you




Similar Threads
Thread Thread Starter Forum Replies Last Post
checkpassword control new password not accepting aruni_cbe ASP.NET 2.0 Professional 4 December 7th, 2010 02:35 AM
problem with password recovery control ghadeer_ BOOK: Professional ASP.NET 3.5 Security, Membership, and Role Management ISBN: 978-0-470-37930-1 0 February 20th, 2010 07:10 AM
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





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