Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
i am using Recover Password control in my application.
I have done changes in web.config such as
XML
<system.net>
    <mailSettings>
      <smtp from="rashidchamp1@gmail.com" deliveryMethod="Network">
        <network host="smtp.gmail.com" port="587" userName="abc@gmail.com" password="XXXX" defaultCredentials="false"/>
      </smtp>
    </mailSettings>
  </system.net>

and have used membership tables accordingly.

But when i click on submit to recover a new password via email it shows me error of
System.Net.Mail.SmtpException: 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. x8sm12425810pbr.11

Kindly help
Posted
Updated 9-Feb-12 22:44pm
v2

1 solution

Solution is that gmail requires you to use a secure connection. It can be set in your web.config using enableSsl attribute as true like this:

HTML
<network host="smtp.gmail.com" enablessl="true" port="587" username="abc@gmail.com" password="XXXX" defaultcredentials="false" />
 
Share this answer
 
Comments
RashdSiddique 13-Feb-12 4:42am    
When using enablessl="true" it throws an error of

Unrecognized attribute 'enablessl'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900