Email draft shows in Inbox folder as soon as a file is attached

I have an interesting issue – email draft (MSG format) generated via Aspose shows in Inbox folder as soon as a file is attached to it.

The email does not go out. Just shows up in Inbox as a new email.

Opening that email from Inbox folder opens it properly in draft mode.

If no files are attached, then it does not appear in Inbox.

We are using 2.7.0 Aspose Email for Java.

And this happens only to drafts generated via Aspose Email for Java; not to native drafts from Outlook itself.

Any suggestions and pointers is greatly appreciated.


Hi Praveen,


Thank you for writing to Aspose support team.

Could you please elaborate the steps to reproduce this issue? I have created a sample draft email and tried to reproduce this issue at my end but I am afraid to share that I could not get success. I have used the latest version of Aspose.Email for Java 4.0.0 for testing this issue. Since you are using quite an old version of Aspose.Email for Java, that might be one cause for the issue you are facing. Please use the latest version of Aspose.Email for Java and let us know your feedback.

Thanks for your reply Kashif.

I created the draft using below code snippet.
I have also uploaded a sample draft MSG file. You can try adding an attachment to it and see that it appears in Inbox folder.

MSG file draft creation code snippet:

MapiMessage mapiMsg = MapiMessage.fromMailMessage(mailMessage,OutlookMessageFormat.Unicode);
mapiMsg.setMessageFlags( MapiMessageFlags.MSGFLAG_UNSENT); // MapiMessage is used to create drafts. flag should be set as MSGFLAG_UNSENT
if (StringUtils.isNotBlank(fromAddress)) {
mapiMsg.setSenderEmailAddress(fromAddress);
mapiMsg.setSentRepresentingEmailAddress(fromAddress);
}
//set to response
servletResponse.setHeader("Content-disposition", "attachment; filename="+fileName);
mapiMsg.save(servletResponse.getOutputStream());



I can't use the latest version of Aspose Email for Java due to license restrictions.
Is there a trial latest version that I can use.

Thank you.

Hi Praveen,


Thank you for elaborating the steps.

I was able to reproduce this issue at my end using the latest version of Aspose.Email for Java 4.0.0 and have logged it as NETWRKJAVA-33369 in our issue tracking system for further investigation by our development team. We’ll update you here once there is any information available in this regard.

We regret the inconvenience caused to you.

PS: You can try the latest version of Aspose.Email for Java 4.0.1 by requesting a 30-day temporary license free of cost.