I am trying to extract the created and last modified date of eml file. After going through few posts of similar issue, I tried to load the mailmessage into mapimessage temporarily just to extract these values. I am getting the values as of current time, which is different the original created and last modified datetime of eml file.
MapiConversionOptions option = new MapiConversionOptions();
option.PreserveOriginalDates = true;
MapiMessage message = MapiMessage.FromMailMessage(msg, option);
var mapiproperties = message.Properties;
MapiProperty prop = null;
prop = mapiproperties[MapiPropertyTag.PR_CREATION_TIME];
if (prop != null)
{
DateTime created_datetime = prop.GetDateTime().ToLocalTime();
}
prop = mapiproperties[MapiPropertyTag.PR_LAST_MODIFICATION_TIME];
{
DateTime last_modified = prop.GetDateTime().ToLocalTime();
}
prop = mapiproperties[MapiPropertyTag.PR_MESSAGE_DELIVERY_TIME];
if (prop != null)
{
DateTime recdate = prop.GetDateTime().ToLocalTime();
}
Can you please help??
You can find the file [here ](https://drive.google.com/file/d/1-5oY2HdNWndZMWtxfvaRBt1WC_TyZLAF/view?usp=sharing)