Hi,
chEmailTest:
MailMessage origMessage = MailMessage.load( "C:\\Temp\\test1.msg" ), MessageFormat.getMsg());for (int i = 0; i < origMessage.getAttachments().size(); i++){MapiAttachment attachment = (MapiAttachment) origMessage.getAttachments().get(i);System.out.prinln(attachment.getLongFileName());System.out.prinln(attachment.getFileName());System.out.prinln(attachment.getExtension());}Hi,
Your provided source code is incorrect and it throws java.lang.ClassCastException because you are loading the message into an instance of MailMessage and casting it's attachment to MapiAttachment. I believe you meant the source code as give below,
JavaMapiMessage origMessage = MapiMessage.fromFile( "test1.msg"); for (int i = 0; i < origMessage.getAttachments().size(); i++) { MapiAttachment attachment = (MapiAttachment) origMessage.getAttachments().get(i); System.out.println(attachment.getLongFileName()); System.out.println(attachment.getFileName()); System.out.println(attachment.getExtension()); }I can confirm, if your message is loaded into an instance of MapiMessage then the attachment properties like LongFileName, FileName and Extension are Null. To investigate this issue, I have logged a ticket (NETWRKJAVA-33133) in our bug tracking system.
We will soon sort this out and will keep you posted with updates.Regards,
Sorry that was a typo, the first line should be:
The issues you have found earlier (filed as NETWRKJAVA-33133) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.