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 服务器需要安全连接或客户端未通过身份验证.
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
