Setting the date on migrated email messages with Exchange Web Services

After much failed effort on my part, Matt Stehle at Microsoft graciously provided me the following function to set the PidTagMessageDeliveryTime on a mail item. Thank you, Matt!

public static void SetReceivedDate(ExchangeService service, ItemId itemId, DateTime date)
Item item = Item.Bind(service, itemId, new PropertySet(BasePropertySet.IdOnly));

item.SetExtendedProperty(new ExtendedPropertyDefinition(0x0E06, MapiPropertyType.SystemTime), date);



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s