Sent Date is set to current time while converting MSG to MBOX file using Aspose.Email for Java

The Sent Date is set to current time during msg save from MBOX file. In the uploaded mbox file when using the code below the printed date is right yet the datetime in the msg file is the current system time.

I can’t seem to get it fixed. A work around might be to reread the msg set the date then rewrite it out?

MboxrdStorageReader reader = new MboxrdStorageReader(new FileInputStream(MBOXfile), false);
MailMessage msg;
msg = reader.readNextMessage
System.out.println(“\n”+msg.getDate());
msg.save(“test.msg”, SaveOptions.getDefaultMsgUnicode());

this may be similar to Sent Time missing in PST file

shapelib.zip (1.0 MB)

Using the preserve functions resolved this issue.

setPreserveOriginalDates(true);
setPreserveSignature(true);

@dfplive

Its good to know that you have resolved issue on your own. Please feel free to contact us any time.