Hi,
I’ve loaded a msg file which has another msg file attached to it using the MapiMessage class (see attachment test1.zip).
The internal msg file has an empty email subject. When the attachment is processed using the MapiAttachment class the attachment filename, long file name and extension are all null.
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());
}
The three prinln calls above show that LongFileName, FileName and Extension are null. I need to determine file extension to do some some selective processing of the attachments.
If the msg file is opened in Outlook you can see that the internal msg attachment has the name 'Untitled.msg'. Why isn't this being returned for the file name?
Thanks & regards,