SMTP 服务器需要安全连接或客户端未经过身份验证
SMTP 服务器需要安全连接,或者客户端未经过身份验证。服务器响应为:5.7.0 必须首先发出 STARTTLS 命令。 k12sm3795394wby.16
描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.Net.Mail.SmtpException:SMTP 服务器需要安全连接或客户端未经身份验证。服务器响应为:5.7.0 必须首先发出 STARTTLS 命令。 k12sm3795394wby.16
来源错误:
我正在使用createUserWizard..它的属性中有一个邮件选项,我使用设计器(VS2010)设置。当我使用代码时它起作用了!但是使用该控件时它不起作用。我想知道为什么!!
这是我的 web.config 文件:
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.gmail.com" defaultCredentials="false"
port="587" userName="**********" password="*****"/>
</smtp>
</mailSettings>
</system.net>
但我怀疑控件是否使用该设置。
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k12sm3795394wby.16
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k12sm3795394wby.16
Source Error:
I am using createUserWizard.. it has a mailing option in its properties that i set using the designer (VS2010). When I used code it worked!, but with that control it doesnt. I wonder why!!
Here is my web.config file:
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.gmail.com" defaultCredentials="false"
port="587" userName="**********" password="*****"/>
</smtp>
</mailSettings>
</system.net>
But I doubt the control uses that setting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Gmail 要求您使用安全连接。这可以在你的 web.config 中设置,如下所示:
Gmail requires you to use a secure connection. This can be set in your web.config like this:
Gmail 正在阻止您的 SQL Server 实例通过它发送电子邮件。一旦遇到错误,如果您登录 Gmail 并尝试撰写邮件,它会通知您已阻止的访问。您只需告诉 Gmail 这是合法的,并允许将来从 sqlserver 登录。
这应该可以解决问题!
Gmail is blocking your SQL Server instance from sending emails through it. Once you encounter your error, if you login to gmail and try to compose a message, it'll notify you of an access that it blocked. You just need to tell Gmail that this was ligitimate and to allow future logins from sqlserver.
This should do the trick!