I created my web application and user PasswordRecovery
Control.
My code in html :
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
<MailDefinition From="mail@gmail.com" Subject="ResetPassword"
Priority="High"/>
</asp:PasswordRecovery>
And my web.config code is:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="mail@gmail.com">
<network
host="smtp.gmail.com"
port="25"
password="xxxxxxx"
defaultCredentials="true"/>
</smtp>
</mailSettings>
</system.net>
But I get these errors and it doesn't work.
1-The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
2-A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 173.194.66.109:25
my web.config code is
<configuration>
<system.web>
<roleManager enabled="true" />
<authentication mode="Forms" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<!-- ... -->
<system.net>
<mailSettings>
<smtp from="mail@gmail.com">
<network host="smtp.gmail.com" password="mypassword"
enableSsl="true" port="578" userName="hsadeghi.t@gmail.com" />
</smtp>
</mailSettings>
</system.net>
</configuration>
and form :
<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/master-store.Master"
AutoEventWireup="true" CodeBehind="UserPasswordRecovery.aspx.cs"
Inherits="Store.Pages.userpasswordrecovery" %>
<!-- ... -->
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="wrapper">
<div class="wrapper-rim">
<div class="site-content">
<div class="recovery-password" dir="rtl">
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server"/>
</div>
</div>
</div>
</div>
</asp:Content>