Sent Time missing in PST file

Hello Team,


I have to convert MBOX file to PST file. But after creating PST file , Sent Time is missing. It is saying none. I am using Aspose MboxrdStorageReader for reading on Mac OS X 10.10.3(JAVA Lang.). Please refer below code.

******** Source Code *******

MboxrdStorageReader objMBOXReader = null;

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco} span.s1 {color: #931a68}

MapiMessage f_objMapiMessage = null;


try
{

objMBOXReader = new MboxrdStorageReader(this.m_StrSourceFilePath, true);


int f_intMailCount = 0;


while ((f_objMailMessage = objMBOXReader.readNextMessage()) != null //iterate mails

{

try

{

f_intMailCount++;

f_objMapiMessage= MapiMessage.fromMailMessage(f_objMailMessage);


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco} span.s1 {color: #0326cc} span.s2 {color: #3933ff}

f_Inboxfolder = f_ObjPersonalStorage.getRootFolder().getSubFolder("Mails");


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}

f_Inboxfolder.addMessage(f_objMailMessage);

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}

}

catch(Exception pObj)

{

pObj.printStackTrace();

}


}//end of while loop




}//end of outer try

catch(Exception pObj)

{

pObj.printStackTrace();

}


Please see PST file after open it in microsoft outlook.


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}

Hi Ajinath,


Thank you for contacting Aspose support team.

I have analyzed the sample mbox file using Aspose.Email and observed that all the mails contain X-Unsent: 1. This is causing the sent date to be empty. You can verify this header value using any third party mbox viewer like mboxview.exe. Please check it using mbox viewer and Aspose.Email code as given below:

<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>System.out.println(mail.getHeaders().getKey(0) + “:” + mail.getHeaders().get(0));

Hi Kashif,


I have open that mbox file in Apple Mail Client(Mac OS X) and Thunderbird Mail Client(Windows OS). This file successfully open and it shows sent date correctly. Actually this is MBOX of Thunderbird Mail Client.

Hi Ajinath,


Thank you for additional details. This issue has been logged as EMAILJAVA-34269 for further investigation by our Product team. We’ll update you here once there is some information or a fix version available int his regard.

Hello Kashif,


What about this issue. Give us solution for this issue I have purchase Aspose License. I have waste more time on it. Give us replay as soon as.

Hi Ajinath,


We are sorry to share that there is no ETA available for resolution of this issue as it has been recently logged. Our Product team will soon investigate the issue at its turn and we’ll update you here once there is some information or a fix version available in this regard.

Hello Kashif,

This issue is not resolved with new release that is aspose.email for java api 17.5.0. I am wasting to much time on this issue. Please update me regarding this issue.
Hi Ajinath,

Our product team is working on this issue. A fix for this issue is expected in Aspose.Email for Java version 17.6 which is due in the month of Jun 2017. Again, it is a tentative ETA. It may change with the complexity involved in the resolution of the issue.

Hi Ajinath,


Our Product team has investigated this issue and found it to be something not at Aspose.Email API. This is for the reason that all the extracted messages from the MBox file contain header X-Unsent = 1. Outlook considers this flag for marking messages as Draft instead of sent and sent time is missing from it. Please let us know if we can be of any additional help to you in this regard.

How we can set X-Unsent property using aspose.

@kharade.a,

Yes, you can set this flag to false using the isDraft method of MailMessage as shown in code sample below. Saving with this flag set to false will save the MailMessage in sent mode.

Sample Code

while (message != null)
{
   
    //set X-Unsent: 0 
    message.isDraft(false);

    // Manipulate message - show contents
    Console.WriteLine("Subject: " + message.getSubject());
    // Save this message in EML or MSG format
    message.Save(message.Subject + ".eml", SaveOptions.getDefaultEml());
    message.Save(message.Subject + ".msg", SaveOptions.getDefaultMsgUnicode());

    // Get the next message
    message = reader.readNextMessage();
}

I have used this but it is not work for me some mails shows date time as none again.
please help me

@kharade.a,

It is not a bug of Aspose.Email as all messages in MBOX contain header X-Unsent: 1(this can be seen by any text editor). Aspose.Email does not change message when loading. To solve this issue we provided you sample code to set the IsDraft of MailMessage.

We are not sure why Apple Mail and Kernel OST mark emls from mbox as non-draft. We think it is difference of implementation of these app. Aspose.Email repeats rules of Outlook for conversion of eml to msg.

Please feel free to write us back if you have any other query in this regard.