I’m trying to create a MapiTask using the following code:
InputStream stream = new ByteArrayInputStream(rawTaskDecoded,0,rawTaskDecoded.length); MailMessage mailMessage = MailMessage.load(stream); MapiMessage mapiMessage = MapiMessage.fromMailMessage(mailMessage); MapiTask task1 = (MapiTask) mapiMessage.toMapiMessageItem();
When running it, the following exception is happening:
com.aspose.email.MapiMessage cannot be cast to com.aspose.email.MapiTask
I can create a MapiNote using this code, but when using it to create a MapiTask it does not work.
What can I do to solve this?