【发布时间】:2016-02-03 04:47:36
【问题描述】:
大家好,我正在尝试从我的 ASP.Net Web 应用程序发送一封电子邮件,我正在我的 Web.config 上使用它:
<system.net>
<mailSettings>
<smtp>
<network host="smtp.gmail.com" userName="myemail" password="mypass" port="587" enableSsl="true" />
</smtp>
</mailSettings>
一切都正确,但我收到此错误消息:
System.Net.Mail.SmtpException:
The SMTP server requires a secure connection or not done client authentication.
The server response was: 5.5.1 Authentication Required.
Learn more at at System.Net.Mail.MailCommand.CheckResponse
(SmtpStatusCode statusCode, String response) in System.Net.Mail.MailCommand.Send
(SmtpConnection conn, Byte [] command, MailAddress from, Boolean allowUnicode)
in System.Net. Mail.SmtpTransport.SendMail (MailAddress sender, MailAddressCollection
recipients, String deliveryNotify, Boolean allowUnicode,
SmtpFailedRecipientException & exception) in System.Net.Mail.SmtpClient.Send
(MailMessage message) at Account_Registration.Registration ()
in c: \ Users \ User \ Documents \ Visual Studio 2013 \ WebSites \
MyWebsite \ Account \ Registration.aspx.cs: line 177
正如您在我的 Web.config 文件中看到的那样,我已启用 Ssl,所以我仍然收到此错误,并且我的帐户收到一封电子邮件,表明有人试图在未经许可的情况下使用我的电子邮件。有人可以帮忙吗?
【问题讨论】: