We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Current Date is used for Extracted Date of msg

Sample_CurrentDateAsDate.zip (6.1 KB)
Aspose Team,

We use the Aspose Email java package to extract properties from msg files. For the sample file the value of extracted Date used to be “Sat Jan 01 00:00:00 UTC 1”, but the value is now the same as the current processing date (like “Fri Apr 29 00:29:53 UTC 2022”). I think the change happened in version 21.11.

Following is the sample code that reproduces the problem and attached is the sample msg file.

The operating system is Ubuntu 20.04. Java version is 11. Aspose Email java packages tested are is 21.10, 21.11 and 22.3.

import com.aspose.email.MailMessage;
import com.aspose.email.MsgLoadOptions;
import java.util.Date;

public class CurrentDateAsDate {
public static void main(String[] args) {
try {
String inputMsg = “path-to-sample-file”;
MsgLoadOptions mlo = new MsgLoadOptions();
mlo.setKeepOriginalEmailAddresses(false);
MailMessage mailMessage = MailMessage.load(inputMsg, mlo);
Date date = mailMessage.getDate();
System.out.println(date); // “Fri Apr 29 00:29:53 UTC 2022” with aspose-email 22.3
// “Sat Jan 01 00:00:00 UTC 1” with aspose-email 21.10
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

@xyang

We have logged this problem in our issue tracking system as EMAILJAVA-35047. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.