加載某些電子郵件MimeConent當我嘗試使用下面的代碼來獲得一個電子郵件附件的MIME內容無法使用EWS API
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個附件,可空1 bodyType, IEnumerable
1個additionalProperties,ServiceErrorHandling ErrorHandling中) 在Microsoft.Exchange.WebServices.Data.ExchangeService.GetAttachment(附件附接,可空1 bodyType, IEnumerable
1 additionalProperties) 在Microsoft.Exchange.WebServices.Data.Attachment。 InternalLoad(可空值1 bodyType, IEnumerable
1個附加屬性) 在Microsoft.Exchange.WebServices.Data.ComplexProperty.LoadFromXml(EwsServiceXmlReader reader,XmlNamespace xmlNamespace,String xmlElementName)上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讀者,字符串xmlElementName) 在Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.InternalLoadFromXml(EwsServiceXmlReader閱讀器,屬性包的PropertyBag) 在Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.LoadPropertyValueFromXml(EwsServiceXmlReader閱讀器,屬性包的PropertyBag ) at Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader,Boolean clear,PropertySet requestedPropertySet,Boolean onlySummaryP ropertiesRequested) 在Microsoft.Exchange.WebServices.Data.ServiceObject.LoadFromXml(EwsServiceXmlReader讀卡器,布爾clearPropertyBag) 在Microsoft.Exchange.WebServices.Data.ItemAttachment.TryReadElementFromXml(EwsServiceXmlReader讀取器) 在Microsoft.Exchange.WebServices.Data.ComplexProperty .InternalLoadFromXml(EwsServiceXmlReader閱讀器,XML命名空間XML命名空間,字符串xmlElementName,函數功能2 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讀取器) 在Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader) 在Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase。 ReadResponse(HttpWebResponse響應) InnerException:
我觀察到什麼是發生這種情況時的特定電子郵件附件是Undeliberable電子郵件與下面內容:
電子郵件系統有一個問題,處理此消息。 Exchange不會嘗試爲您重新傳送此消息。
爲管理員診斷信息:
生成服務器:MAIL.saaital.com
550 5.6.0 M2MCVT.StorageError;存儲內容轉換錯誤
任何提示..指針? 。真的需要幫助,因爲我一直在努力處理這個特定的電子郵件附件。
它在Windows 2008 R2上的Exchange 2010。我正在嘗試處理包含以上內容的無法投遞的電子郵件的雜誌報告。謝謝 – Sameer
因此,您沒有應用任何服務包? –
是的,你說得對。 – Sameer