Incorrect created and last modification date of eml file


#1

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


#2

@mudassir.fayyaz,
Can you please look at this issue ?


#3

@alishasharma,

Can you please share source file so that we may further investigate to help you out.


#4

@Adnan.Ahmad,
Are you asking for source code file ??


#5

@alishasharma,

I like to inform that code snippet you have shared includes some undeclared variables so would you please share your SSCCE code reproducing the issue so that we may try to reproduce and investigate it in our environment.