The item you tried to access to longer exists

2019-09-08 11:32发布

Here is the screen-shot of an email whose attachment I am trying to access.

enter image description here

When I try to open the attachment, I am getting the below error

enter image description here

What is the reason behind this, and how can this be solved?

I am trying to process emails using EWS api and my process is stuck on this email because while processing this email I am getting the below error(when Loading the MimeContent of this particular email).

this is the code

var message = EmailMessage.Bind(exchangeService, itemid,
                                       new PropertySet(
                                                       ItemSchema.Attachments));

    exchangeService.TraceListener=new TraceListener();
    exchangeService.TraceEnabled = true;
    message.Load(new PropertySet(ItemSchema.MimeContent)); // Getting exception here.
   //  File.WriteAllBytes("email.eml", message.MimeContent.Content);

And this is the error I am getting.

Microsoft.Exchange.WebServices.Data.ServiceRequestException occurred
HResult=-2146233088 Message=The request failed. Unable to read data from the transport connection: The connection was closed.
Source=Microsoft.Exchange.WebServices

0条回答
登录 后发表回答