Adding embedded MSG to a MapiMessage

Is there a way to create an embedded attachment to a MapiMessage?

When I attach an email to another in Outlook I can see that the MapiProperty PR_ATTACH_METHOD = 5 and that PR_ATTACH_DATA_OBJ = Object.

Is there a way to create a new MapiMessage and add an attachment such that it will have the same PR_ATTACH_METHOD tag?

Thanks,
//C

Hi,


Thank you for contacting Aspose Support team.

Please try the following sample code which attaches a MSG file as embedded attachment to an email and let us know your feedback.

Sample code

MapiMessage message = new MapiMessage(“from@test.com”, “to@test.com”, “Subj”, “This is a message body”);
MapiMessage attachMsg = MapiMessage.FromFile(“Test.msg”);
message.Attachments.Add(“Weekly report”, attachMsg);
message.Save(“WithEmbeddedMsg.msg”);

That worked.
Sorry I didn’t see that in the javadoc.

//C

Hi,


You are welcome and please feel free to write to us for your additional queries related to the API.