Hi,
I have the following piece of code:
for (int k = 0; k < messageInfoCollection.size(); k++)
{
MessageInfo messageInfo = (MessageInfo) messageInfoCollection.get_Item(k);
MapiMessage message = pst.extractMessage(messageInfo);String bsId = message.getHeaders().getDecodedValue(“X-MSGID”);
if (bsId.equals(it_local.id))
{
console.println(Console.output, “DELETED_EMAIL||” + folder.fullPath + “||” + pstFile.FormatSubject(it_local.subject));targetFolder.deleteChildItem(messageInfo.getEntryId()); break;
}
message.dispose();
}
When running it, it deletes the message from folder, but also throws the following exception:
Could not read message. The message data is probably corrupted.
What can I do to avoid this exception?
Thanks