i have a problem with password recovery control http://forums.asp.net/t/1527828.aspx/1?i+have+a+problem+with+password+recovery+control+Wed, 24 Feb 2010 10:39:01 -050015278283690627http://forums.asp.net/p/1527828/3690627.aspx/1?i+have+a+problem+with+password+recovery+control+i have a problem with password recovery control <p>Hello,<br> <br> Having typed the code out about tha passsword recovery control and I get the following error.<br> <b>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</b><br> <br> please any help i will be faithful..<br> <br> my code as follows in aspx file:<br> &lt;asp:PasswordRecovery ID=&quot;PasswordRecovery1&quot; runat=&quot;server&quot; OnSendingMail=&quot;PasswordRecovery1_SendingMail&quot; &gt;<br> &lt;MailDefinition BodyFileName=&quot;~/EmailTemplate/PasswordRecovery.txt&quot; <br> Subject=&quot;your password has been reset...&quot; From=&quot;temn.cis.just@gmail.com&quot; <br> Priority=&quot;High&quot;&gt;<br> <br> the code that i include it in the web config:<br> &lt;system.net&gt;<br> &lt;mailSettings&gt;<br> &lt;smtp deliveryMethod=&quot;Network&quot; from=&quot;myUserName@gmail.com &quot;&gt;<br> &lt;network host=&quot;smtp.gmail.com&quot; port=&quot;587&quot; userName=&quot;MyUserNamer@gmail.com&quot; password=&quot;Mypassword&quot; defaultCredentials=&quot;true&quot;/&gt;<br> &lt;/smtp&gt;<br> &lt;/mailSettings&gt;<br> &lt;/system.net&gt;<br> <br> and the code that included in the aspx.cs file is:<br> <br> <br> protected void Page_Load(object sender, EventArgs e)<br> {<br> MailMessage myMessage = new MailMessage();<br> SmtpClient mySmtpClient = new SmtpClient();<br> myMessage.To.Add(new MailAddress(&quot;MyUserName@gmail.com&quot;));<br> mySmtpClient.Port = 587;<br> mySmtpClient.Credentials = new System.Net.NetworkCredential(&quot;MyUserName@gmail.com &quot;, &quot;MyPassword&quot;);<br> mySmtpClient.EnableSsl = true;<br> mySmtpClient.Send(myMessage);<br> }<br> <br> protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)<br> {<br> SmtpClient mySmtpClient = new SmtpClient();<br> mySmtpClient.EnableSsl = true;<br> mySmtpClient.Send(e.Message);<br> e.Cancel = true;<br> }<br> <br> <br> the text that i include it in the PasswordRecovery.txt is:</p> <p><br> Your password has been reset, &lt;%UserName%&gt;! <br> According to our records, you have requested that your password be reset.<br> Your new password is: &lt;%Password%&gt;<br> If you have any questions or trouble logging on please contact a site administrator. <br> Thank you!<br> <br> to give that user random password and user name to get log in again....<br> cheers <br> i will be faithful please any help i need it<br> <br> ghader</p> <p><br> </p> 2010-02-20T09:42:15-05:003691587http://forums.asp.net/p/1527828/3691587.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p>Hi</p> <p>Try after removing the following line of code:</p> <p><b>mySmtpClient.Port = 587;</b></p> <p>If it does n't work, try using the port <b>465</b>.</p> <p>Also, remove the settings in the web.config. Folllowing is the sample code that sends a simple email using Gmail smtp, it is in VB but you can surely have an idea:<br> </p> <p><br> </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> Dim mm As New MailMessage()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mm.To.Add(&quot;toAddress&quot;)<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mm.From = New MailAddress(&quot;FromAddress&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mm.Subject = &quot;Test Subject&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mm.Body = &quot;Message Details&quot;<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim ss As New SmtpClient(&quot;smtp.gmail.com&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.Credentials = New System.Net.NetworkCredential(&quot;username&quot;,&quot;password&quot;)<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.EnableSsl = True<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ss.Send(mm)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b></p> <p>The above code will work, if you are not behind a proxy and directly connected to the internet. <br> </p> <p><br> </p> 2010-02-21T06:33:15-05:003692066http://forums.asp.net/p/1527828/3692066.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p></p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;hello adeelehsan&nbsp;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;i have made what you said exactly&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;1- i have used the 465 port.&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;but now i have another problem which is :&lt;/div&gt; <p></p> <p>hello adeelehsan&nbsp;</p> <p>i have made what you said exactly</p> <p>1- i have used the 465 port.</p> <p>but now i have another problem which is :</p> <p><b>Exception Details: System.Net.Mail.SmtpException: The operation has timed out.</b></p> <p><b>with this:</b></p> <p><b></b></p> <p><b></p> <p>Source Error:&nbsp;</p> <p>Line 86: &nbsp; &nbsp; &nbsp; &nbsp; ss.Credentials = new System.Net.NetworkCredential(&quot;MyUserName@gmail.com&quot;, &quot;MyPassword&quot;);</p> <p>Line 87: &nbsp; &nbsp; &nbsp; &nbsp; ss.EnableSsl = true;</p> <p><i><u>Line 88: &nbsp; &nbsp; &nbsp; &nbsp; ss.Send(mm);</u></i></p> <p></p> <p><span class="Apple-style-span" style="font-weight:normal">but look if i used 587Port for the gmail outgoing server the message is sent with it's properties but with this error</span>&nbsp;</p> <p>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</p> <p><span class="Apple-style-span" style="font-weight:normal">really i don't know what to do<img src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif" alt="Undecided" title="Undecided" border="0"></span></p> <p><span class="Apple-style-span" style="font-weight:normal">please if you have any information i need i</span>t</p> <p></p> <p><i><u><br> </u></i></p> </b> <p></p> <p></p> <p></p> <p></p> 2010-02-21T15:56:34-05:003692784http://forums.asp.net/p/1527828/3692784.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p>Hi</p> <p>Try with the following 2 make sures:</p> <p>1) Do not use any port</p> <p>2) Make sure you are not behind a proxy.<br> </p> 2010-02-22T05:27:23-05:003692868http://forums.asp.net/p/1527828/3692868.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p></p> <blockquote><span class="icon-blockquote"></span> <h4>adeelehsan</h4> <p>1) Do not use any port</p> <p></p> </blockquote> &nbsp; <p></p> <p>i have&nbsp; try without any port &gt;&gt;the exception that appeared that&nbsp;you have not&nbsp;specified any port fo rthe smtp server</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>adeelehsan</h4> 2) Make sure you are not behind a proxy.<br> </blockquote> <p></p> <p>am sure that i am not behind a proxy...</p> <p>shall i have any setting related to the gmail mail that i sent from it ????</p> 2010-02-22T06:24:39-05:003697357http://forums.asp.net/p/1527828/3697357.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p>Hi,</p> <p>Try to&nbsp;delete some code like below:</p> <p>&nbsp;&lt;system.net&gt;<br> &lt;mailSettings&gt;<br> &lt;smtp deliveryMethod=&quot;Network&quot; from=&quot;myUserName@gmail.com &quot;&gt;<br> &lt;network host=&quot;smtp.gmail.com&quot; port=&quot;587&quot; <strong><u>enableSsl=&quot;true&quot;</u></strong> userName=&quot;MyUserNamer@gmail.com&quot; password=&quot;Mypassword&quot;<strong> <strike>defaultCredentials=&quot;true&quot;</strike></strong>/&gt;<br> &lt;/smtp&gt;<br> &lt;/mailSettings&gt;<br> &lt;/system.net&gt;<br> <br> and the code that included in the aspx.cs file is:<br> <br> <br> <strike>protected void Page_Load(object sender, EventArgs e)<br> {<br> MailMessage myMessage = new MailMessage();<br> SmtpClient mySmtpClient = new SmtpClient();<br> myMessage.To.Add(new MailAddress(&quot;MyUserName@gmail.com&quot;));<br> mySmtpClient.Port = 587;<br> mySmtpClient.Credentials = new System.Net.NetworkCredential(&quot;MyUserName@gmail.com &quot;, &quot;MyPassword&quot;);<br> mySmtpClient.EnableSsl = true;<br> mySmtpClient.Send(myMessage);<br> }<br> <br> protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)<br> {<br> SmtpClient mySmtpClient = new SmtpClient();<br> mySmtpClient.EnableSsl = true;<br> mySmtpClient.Send(e.Message);<br> e.Cancel = true;<br> }<br> </strike></p> 2010-02-24T04:45:57-05:003697916http://forums.asp.net/p/1527828/3697916.aspx/1?Re+i+have+a+problem+with+password+recovery+controlRe: i have a problem with password recovery control <p>Because Gmail requires a&nbsp;different port as the default port, are you sure your (shared ?) hosting provider allow you to use this port?&nbsp;So please ask, otherwise all your efforts are usesless...&nbsp;</p> 2010-02-24T10:39:01-05:00