当前位置: 代码迷 >> ASP.NET >> 邮件发送失败,System.IO.IOException: 因为远程方已关闭传输流,身份验证失败
  详细解决方案

邮件发送失败,System.IO.IOException: 因为远程方已关闭传输流,身份验证失败

热度:10559   发布时间:2013-02-25 00:00:00.0
邮件发送失败,System.IO.IOException: 由于远程方已关闭传输流,身份验证失败。
在服务器上用foxmail是发送成功的,本地调试也是成功的

为什么服务器上会报错?


日志如下

System.Net.Mail.SmtpException: 发送邮件失败。 ---> System.IO.IOException: 由于远程方已关闭传输流,身份验证失败。
  在 System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
  在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
  在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
  在 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
  在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
  在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
  在 System.Net.TlsStream.CallProcessAuthentication(Object state)
  在 System.Threading.ExecutionContext.runTryCode(Object userData)
  在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
  在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
  在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
  在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  在 System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
  在 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
  在 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
  在 System.Net.Mail.SmtpConnection.Flush()
  在 System.Net.Mail.ReadLinesCommand.Send(SmtpConnection conn)
  在 System.Net.Mail.EHelloCommand.Send(SmtpConnection conn, String domain)
  在 System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
  在 System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
  在 System.Net.Mail.SmtpClient.GetConnection()
  在 System.Net.Mail.SmtpClient.Send(MailMessage message)
  --- 内部异常堆栈跟踪的结尾 ---
  在 System.Net.Mail.SmtpClient.Send(MailMessage message)

------解决方案--------------------------------------------------------
把服务器上的 杀毒。防火都关闭。用个新浪的发送试试
  相关解决方案