How to Retrieve Attachments Larger Than 5MB Using EWS

WongYK 5 Reputation points
2025-01-09T07:39:30.9833333+00:00

I'm working with Exchange Web Services (EWS) and need assistance on how to retrieve attachments that are larger than 5MB. By default, EWS seems to limit the attachment size for retrieval, but I need to ensure that larger attachments can be fetched. Could anyone share how to handle this scenario and any configuration that might be required on the server side to support large attachments? If possible, can you provide a sample code snippet for this?

Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Exchange | Exchange Server | Development
Exchange | Exchange Server | Management
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-01-10T06:00:56.7333333+00:00

    Hi, @WongYK

    To retrieve attachments larger than 5MB using Exchange Web Services (EWS), you first need to make sure that your Exchange server is configured to support larger attachments. This may involve updating certain settings on the server side, but this is usually handled by the Exchange administrator. The configuration settings include parameters such as 'MaxSendSize', 'MaxReceiveSize' and 'MaxAttachmentSize'.

    Unfortunately, the “Exchange Server Management” tag currently focuses only on mail and mail flow, not code.

    You can refer to exchange server - How to download >1 MB Email attachment using EWS in C# - Stack Overflow

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.