Facing problem in assigning a property

Hello,

I am facing problem in assigning a property “sent on behalf” for mail in MapiMessage will you please help.

Thanks and Regards
Shital

@Shital,

Could you please share such a MSG file with us that has such a property? We need the sample file for analyzing the properties to be set in order to achieve this.

Hello,

I have attached the sample please have a look.
test for on behalf of (1).zip (3.9 KB)

Thanks and Regards
Shital

@Shital_diwate,

Thank you for providing the sample message file. You may please use following sample code to set the said properties and share the feedback.

MapiMessage mapi1 = new MapiMessage("jack@systoolssoftware.org", "abc@systoolssoftware.org", "Subject", "Body");
mapi1.SenderName = "Harry";
mapi1.SentRepresentingEmailAddress = "jarry@systoolssoftware.org";
mapi1.SentRepresentingName = "jarry@systoolssoftware.org";
//MSGFLAG_UNSENT
mapi1.SetMessageFlags(~MapiMessageFlags.MSGFLAG_UNSENT);
mapi1.Save(@"OnBehalfOf.msg");