C# 在生产服务器上使用mail.live.com发送邮件失败

C# 在生产服务器上使用mail.live.com发送邮件失败,c#,.net,email,smtpclient,C#,.net,Email,Smtpclient,我有一个简单的脚本来发送邮件。这可以在本地运行并发送电子邮件。但是,当部署到生产服务器时,我会遇到此错误 Authentication failed because the remote party has closed the transport stream. Description: An unhandled exception occurred during the execution of the current web request. Please review the s

我有一个简单的脚本来发送邮件。这可以在本地运行并发送电子邮件。但是,当部署到生产服务器时,我会遇到此错误

Authentication failed because the remote party has closed the transport stream.

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.IO.IOException: Authentication failed because the remote party has closed the transport stream.

Source Error: 

An unhandled exception was generated during the execution of the current web request. >Information regarding the origin and location of the exception can be identified using the exception stack trace below.
邮政编码:

try
{
   SmtpClient smtp = new SmtpClient();
   smtp.EnableSsl = true;
   smtp.DeliveryMethod = SmtpDeliveryMethod.Network; 
   smtp.Send(message);
}

catch (Exception ex)
{
   throw ex;
}
配置设置:

  <system.net>
    <mailSettings>
     <smtp from="support@domain.com">
       <network host="smtp.live.com" password="password" port="587" userName="support@domain.com"  enableSsl="true"/>
     </smtp>
    </mailSettings>
  </system.net>

你知道为什么它在生产中失败了吗


注意:在使用Gmail时(更改端口和主机配置设置后),同样的代码也起了作用。

在Web服务器上添加SSL证书解决了问题。

我认为这是服务器上的SSL证书的问题。看看是否有帮助。。。