I’m afraid the code in the shared documentation link is throwing exception too
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET
MapiMessage msg = MapiMessage.FromFile(dataDir + "Contact.msg");
MapiContact mapiContact = (MapiContact)msg.ToMapiMessageItem();
The above code throws the same exception as mine.
com.aspose.email.MapiMessage cannot be cast to com.aspose.email.MapiContact
I have created an issue with ID EMAILJAVA-34752 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
I am having the same issue that kelberuc reported above. Is there any update on resolving this?
In the meantime I have concluded the only way to proceed is by creating a MapiTask and then invoking the setter methods for the fields not populated by the constructor (since my source data is not in .ics format).
Thank you for the reply. But if you need to create a Task object and populate it before converting it in this way, I do not understand the advantage over creating the MapiTask object via its constructor & invoking any necessary setters.
Actually, the solution was shared with regards to usages scenario shared by @kelberuc above. The MimeContent.zip attached to the ticket did not contain any task data and we have shared code how to add Task info to empty MailMessage.