Date problem when saving mail

Hi,

I'm using EWS Managed API 2.2 with Visual Basic 2013. I'm trying to import EML file to user mailbox using EMailMessage Save method, and it works great, but received date in Outlook is set to today's date. I'd like it to be date found in EML file.

Can anyone point me as to how to do that?

Thanks

Denis

<link href="chrome://s3gt/skin/s3gt_tooltip.css" rel="stylesheet" type="text/css" />
March 11th, 2015 2:03am

You would need to set the delivery time explicitly in the create. AFAIK Exchange ignores the received date in the MIME stream. Something like this should work:

ExtendedPropertyDefinition PidTagMessageDeliveryTime =
	new ExtendedPropertyDefinition(0x0E06, MapiPropertyType.SystemTime);
DateTime deliveryTime = new DateTime(2015, 3, 10, 10, 0, 0);
email.SetExtendedProperty(PidTagMessageDeliveryTime, deliveryTime);

  • Marked as answer by Shishko 2 hours 27 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 11th, 2015 11:57am

Thank you very much, Jason! That's exactly what I was looking for!

March 12th, 2015 12:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics