【发布时间】:2016-10-09 16:09:45
【问题描述】:
我创建了我的 Web 应用程序和用户 PasswordRecovery Control。
我的 html 代码:
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
<MailDefinition From="mail@gmail.com" Subject="ResetPassword"
Priority="High"/>
</asp:PasswordRecovery>
而我的 web.config 代码是:
<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>
但是我得到这些错误并且它不起作用。
1 - SMTP 服务器需要安全连接或客户端未通过身份验证。服务器响应为:5.5.1 Authentication Required。
2-连接尝试失败,因为连接的一方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应173.194.66.109:25
我的 web.config 代码是
<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>
和形式:
<%@ 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>
【问题讨论】:
-
破解此链接。 [在此处输入链接描述][1] [1]:stackoverflow.com/questions/6097333/…