How to set autoforwarded to true?

Hi there,

A quick question, after we created a MapiMessage object, how to set autoforward to true?
Will the code below work?

mapiMsg.setProperty(new MapiProperty(MapiPropertyTag.PR_AUTO_FORWARDED, new byte[] {1}))

Thanks

Hi,

Thank you for writing to Aspose support team.

Please try the following code sample which sets the value to true. If you have any additional query in this regard, please feel free to write to us.

Sample Code:

static void TestMsgFlagIssue()

{

MapiMessage mapiMsg = new MapiMessage("from@test.com", "to@test.com", "test", "this is a test body");

mapiMsg.setProperty(new MapiProperty(MapiPropertyTag.PR_AUTO_FORWARDED, longToBytes(1)));

mapiMsg.save("2.msg");

}

static byte[] longToBytes(long value)

{

byte[] d = new byte[8];

d[0] = (byte)(value & 0xFF);

d[1] = (byte)((value & 0xFF00) >> 8);

d[2] = (byte)((value & 0xFF0000) >> 16);

d[3] = (byte)((value & 0xFF000000L) >> 24);

d[4] = (byte) 0x03;

return d;

}