I need to Download Email Attachments from Exchange Server using Exchange Web Service API 2.1 I was tried FindItemResults. Minimum size of files can be download. but, If the file size is above 1 MB(I tried with 2MB file). It takes More time and throw Time expired Exception. I know Why this exception. But My question is, can I download big size of attachments?
How to download >1 MB Email attachment using EWS in C#
1.1k views Asked by Suresh Kumar At
2
There are 2 answers
3
On
The default timeout in the EWS Managed API is 90 seconds so if the download isn't completing in that time you'll get a time out exception thrown. You can just increase the timeout by setting the timeout property on the ExchangeService class eg
Service.Time = 300000;
300000 = 300000 milliseconds or 5 minutes
Cheers Glen
You should use GetItem, not FindItem. Use FindItem to get the Id och the mail with the attachment, then get the entire mail with GetItem.
You can modify the code in this great answer to suit your needs: Exchange Web Services API : get mail attachments