【发布时间】:2013-07-25 21:11:16
【问题描述】:
我正在使用 amazon ses 发送电子邮件,并且我在网站和 Windows 应用程序中使用相同的配置。
该网站正在正常发送电子邮件,但 Windows 应用程序给了我这个错误,而不是发送电子邮件:
请注意,当我将 Windows 应用程序中的 smtp 配置更改为 gmail 之类的东西时,它工作正常,问题发生在亚马逊 ses 上,并且就在今天开始发生,然后 ses 在 Windows 应用程序上工作正常。
另请注意,网站和 Windows 应用程序现在都在本地运行。
堆栈跟踪:
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Mail.SmtpConnection.Flush()
at System.Net.Mail.ReadLinesCommand.Send(SmtpConnection conn)
at System.Net.Mail.EHelloCommand.Send(SmtpConnection conn, String domain)
at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at Mail.EmailSender.SendMail(MailMessage mail) in e:\Mail\EmailSender.cs:line 175
内部异常:
{"The message received was unexpected or badly formatted"}
【问题讨论】:
-
您能发布内部异常详细信息和/或完整堆栈跟踪吗?
-
在您的 Windows 应用程序运行的机器上,您是否有任何防火墙规则阻止出站连接?
-
可能是,但我在同一台机器上的另一个 win 应用程序中使用相同的配置,一切正常。
-
对不起,如果我有点分歧,但您是否尝试过从另一台机器或另一个网络运行此应用程序?
-
同一个应用程序现在不能在其他机器上运行,但是具有相同 smtp 配置的其他应用程序即使在同一台机器上也能正常运行
标签: c# asp.net security smtp amazon-ses