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

Free Support Forum - aspose.com

Unsupported File Format Exception while save message in .MSG format(Aspose.Email For Java API)

Hi,
I have to read PST file one by one and save each mail into MSG format. but while loading or saving MSG i got exception like Unsupported File Format. Please provide me the reason and solution regarding this.
Please refer below code and sample to demonstrate the issue.

Source Code :-

MapiMessage f_objMapiMessage = null;
IGenericEnumerable f_mapiMessageCollection =
p_objFolderInfo.enumerateMapiMessages();
IGenericEnumerator f_Iterator = null;

f_Iterator = f_mapiMessageCollection.iterator();
while(f_Iterator.hasNext())
{
f_objMapiMessage = f_Iterator.next();
if (f_objMapiMessage != null && f_objMapiMessage.getMessageClass().equals(“IPM.Note”))
{
f_objMapiMessage.save(f_StrDestinationPath); // mapi message gets saved at the destination
}
}

sample :-
Link :- [http://downloads.systoolsgroup.com/installer/Zero_Mail/Zero_Mail_MBOX_Fail.pst.zip ](http://downloads.systoolsgroup.com/installer/Zero_Mail/Zero_Mail_MBOX_Fail.pst.zip)

Thanks You
Ajinath Kharade
(Product Engineer)

@kharade.a,

Which version of API are you using at your end? We are unable to reproduce the issue at our end with your sample file and latest version of the API. Please try it with the latest version and let us know your feedback.