Setting the date on migrated email messages with Exchange Web Services
Submitted by sami on Fri, 04/16/2010 - 11:23
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);
item.Update(ConflictResolutionMode.AutoResolve);
}



