Hi there,
I am trying to add the content of a string to the mapi property PR_TRANSPORT_MESSAGE_HEADERS (tag 0x007D001E) of a mapimessage
I cannot see how to add this property to the existing properties.
Your advice is much appreciated.
Lee
Hi there,
Hi Lee,
This header is set by the transport provider and can be set manually as follow. Please try the following code at your end and share your feedback with us.
Code:
MailMessage eml = new MailMessage("from@domain.com", "to@domain.com", "Subject", "Body");
eml.isDraft(false);
MapiMessage message = MapiMessage.fromMailMessage(eml);
String s = "Transport Headers";
byte[] b = s.getBytes(Charset.forName("UTF-8"));
MapiProperty property = new MapiProperty(MapiPropertyTag.PR_TRANSPORT_MESSAGE_HEADERS, b);
message.setProperty(property);
message.save("1.msg");
Thanks for your reply, it was a useful pointer but this resulted in garbage being saved.
Hi Lee,