EwsDownloadEntireMessage Method
Downloads the specified item by its ID and returns it as MailMessage object.

Namespace: MailBee.EwsMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public MailMessage DownloadEntireMessage(
	ItemId id
)

Parameters

id
Type: ItemId
The ID of the item. Null reference (Nothing in Visual Basic) not allowed.

Return Value

Type: MailMessage
The downloaded e-mail, or a null reference (Nothing in Visual Basic) on error.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks

To get item IDs, you can use DownloadItemIds(FolderId, Boolean) or Search(FolderId, SearchFilter) methods and then pass Id of items of the returned list to the current method. If you have a string ID (UniqueId), you can create ItemId using #ctor(String) constructor.

This method downloads the entire message with attachments as MailBee's MailMessage object. MS Exchange also lets you download attachments separately (if you know their string IDs) using EWS Managed API, see DownloadNativeAttachments(String, Boolean) method for details.

To download multiple entire messages or learn message flags like unread status, you can use a method like DownloadItems(FolderId, Int32, Int32, Boolean, EwsItemParts) passing MailMessageFull as parts parameter value. The mail messages can then be accessed with MailBeeMessage property for each EwsItem in the returned list.

See Also