The SMTP server requires a secure connection or the client was not authenticated.(SMTP 服务器需要安全连接或客户端未通过身份验证.)
问题描述
我正在使用 asp 中的createuserwizard"创建一个表单.这是我的代码.
I am creating a form using "createuserwizard" in asp.This is my code.
<asp:CreateUserWizard ID="userwizard" ContinueDestinationPageUrl="~/secretfiles/secret.aspx" runat="server" >
<MailDefinition BodyFileName="register.txt" Subject="Registration Confirmation" From="amrit.enest@gmail.com" />
</asp:CreateUserWizard>
这是我的 web.config 文件设置.
This is my web.config file settings.
<mailSettings>
<smtp deliveryMethod="Network" from="amrit.enest@gmail.com">
<network host="smtp.gmail.com" port="25" userName="amrit.enest@gmail.com" password="sending emails's password" />
</smtp>
</mailSettings>
然后设置了一个 Smtp.在 ISS 设置中我选择了以下选项.
Then settled up a Smtp .in ISS settings i selected following options.
->Use localhost(SMTP)
->port=25
->authentication not required
现在当一个新用户点击提交按钮时,它会给出以下错误消息并且邮件没有被发送.
Now when a new user click submit button ,it gives following error message and mail is not being send.
SMTP 服务器需要安全连接或客户端未通过身份验证.服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令.ud8sm21095949igb.4
请大家帮忙.
推荐答案
使用enableSsl="true"
,像这样:
<mailSettings>
<smtp deliveryMethod="Network" from="amrit.enest@gmail.com">
<network enableSsl="true" host="smtp.gmail.com" port="25" userName="amrit.enest@gmail.com" password="sending emails's password" />
</smtp>
</mailSettings>
这篇关于SMTP 服务器需要安全连接或客户端未通过身份验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SMTP 服务器需要安全连接或客户端未通过身份验证.


- 如何用自己压缩一个 IEnumerable 2022-01-01
- 输入按键事件处理程序 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01