1

I am using Default asp.net membership for user log in, register system. I am going to implement Password recovery option in my web application. I am developing my application in home and using default localhost server.

I made a RecoverPassword.aspx page here is its code:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RecoverPassword.aspx.cs" Inherits="myshop.Account.RecoverPassword" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:PasswordRecovery ID="RecoverPwd" runat="server"></asp:PasswordRecovery>
</asp:Content>

I then edit my web.config file here is code:

<system.net> 
  <mailSettings> 
    <smtp deliveryMethod="Network" from="mymail@gmail.com">
       <network
          host="smtp.gmail.com"
          port="587"  
          enableSsl="true"
          password="mypassword"
          userName="mymail@gmail.com"
          defaultCredentials="true"/> 
    </smtp> 
</mailSettings>
</system.net>

After saving when I run my PasswordRecover.aspx page and I give the user name in text box and hit the submit button I get following error.

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

I did not know where is the problem I not get any email on my gmail account please help

rene
  • 41,474
  • 78
  • 114
  • 152
Sameer Ahmed
  • 57
  • 1
  • 4

1 Answers1

0

You can try to set "enable ssl" property to true in your code

smtpClient.EnableSsl = true;
Sargis Koshkaryan
  • 1,012
  • 3
  • 9
  • 19