当我尝试使用以下代码获取电子邮件附件的 Mime内容时
msgAttachment.Load(new PropertySet(ItemSchema.MimeContent));
MimeContent mc = msgAttachment.Item.MimeContent;
我在第二行获得以下异常
发生了Microsoft.Exchange.WebServices.Data.ServiceRequestException 的HResult = -2146233088 消息=请求失败。无法从传输连接读取数据:连接已关闭。 来源= Microsoft.Exchange.WebServices 堆栈跟踪: 在Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(HttpWebResponse响应) 在Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute() 在Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest
1.Execute() at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalGetAttachments(IEnumerable
1个附件,Nullable1 bodyType, IEnumerable
1 additionalProperties,ServiceErrorHandling errorHandling) 在Microsoft.Exchange.WebServices.Data.ExchangeService.GetAttachment(附件附件,Nullable1 bodyType, IEnumerable
1 additionalProperties) 在Microsoft.Exchange.WebServices.Data.Attachment.InternalLoad(Nullable1 bodyType, IEnumerable
1 additionalProperties) 在Microsoft.Exchange.WebServices.Data.ItemAttachment.Load(IEnumerable1 additionalProperties) at Presensoft.JournalEmailVerification.EmailVerification.DownloadFailedAttachments(EmailMessage msg, JournalEmail journalEmail) in D:\Source\ProductionReleases\Release_8.0.7.0\Email Archiving\Presensoft.JournalEmailVerification\EmailVerification.cs:line 621 InnerException: System.IO.IOException HResult=-2146232800 Message=Unable to read data from the transport connection: The connection was closed. Source=System StackTrace: at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.Compression.GZipStream.Read(Byte[] array, Int32 offset, Int32 count) at System.Xml.XmlTextReaderImpl.ReadData() at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlCharCheckingReader.Read() at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read() at Microsoft.Exchange.WebServices.Data.ComplexProperty.InternalLoadFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName, Func
2 readAction) 在Microsoft.Exchange.WebServices.Data.ComplexProperty.LoadFromXml(EwsServiceXmlReader reader,XmlNamespace xmlNamespace,String xmlElementName) 在Microsoft.Exchange.WebServices.Data.ComplexProperty.LoadFromXml(EwsServiceXmlReader reader,String xmlElementName) 在Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.InternalLoadFromXml(EwsServiceXmlReader reader,PropertyBag propertyBag) 在Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.LoadPropertyValueFromXml(EwsServiceXmlReader reader,PropertyBag propertyBag) 在Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader,Boolean clear,PropertySet requestedPropertySet,Boolean onlySummaryPropertiesRequested) 在Microsoft.Exchange.WebServices.Data.ServiceObject.LoadFromXml(EwsServiceXmlReader reader,Boolean clearPropertyBag) 在Microsoft.Exchange.WebServices.Data.ItemAttachment.TryReadElementFromXml(EwsServiceXmlReader reader) 在Microsoft.Exchange.WebServices.Data.ComplexProperty.InternalLoadFromXml(EwsServiceXmlReader reader,XmlNamespace xmlNamespace,String xmlElementName,Func2 readAction) at Microsoft.Exchange.WebServices.Data.ComplexProperty.LoadFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName) at Microsoft.Exchange.WebServices.Data.ComplexProperty.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName) at Microsoft.Exchange.WebServices.Data.GetAttachmentResponse.ReadElementsFromXml(EwsServiceXmlReader reader) at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName) at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest
1.ParseResponse(EwsServiceXmlReader reader) 在Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader) 在Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(HttpWebResponse响应) InnerException:
我观察到的是当特定电子邮件附件是包含以下内容的无法提供的电子邮件时会发生这种情况:
电子邮件系统在处理此邮件时遇到问题。 Exchange不会尝试为您重新发送此消息。
管理员的诊断信息:
生成服务器:MAIL.saaital.com
Hsfsafda@saaital.com
550 5.6.0 M2MCVT.StorageError;内容转换中的存储错误
任何提示..指针? 。真的需要帮助,因为我一直在努力处理这个特定的电子邮件附件。
答案 0 :(得分:0)
您使用的是Exchange Server 2010 SP3 RU2吗?如果没有,那可能会解决问题。另一张海报遇到了类似的错误,他们还发送了一封附有附件的电子邮件:http://social.technet.microsoft.com/Forums/en-US/fd7ef80e-f80b-47ed-883b-a34511c6233c/a-storage-transient-failure-has-occurred-during-content-conversion?forum=exchangesvrsecuremessaginglegacy。
与此修补程序相关的支持页面位于:http://support.microsoft.com/kb/2863310。