I am trying to write the PR_REPLY_RECIPIENT_ENTRIES MAPI property into a message processed by my Exchange 2007 SP3 transport agent (in C#). I create a tnefWriter object and start to write the new property as follows:
tnefWriter.StartProperty(new TnefPropertyTag(TnefPropertyId.ReplyRecipientEntries, TnefPropertyType.String8))
tnefWriter.WritePropertyValue(emailaddress@somewhere.com);
However I get inconsistent results if I simply write a string value into this property. Either the agent fails to process the message and it gets sent to the poison queue, or the message fails at the next hop which is a custom SMTP=> X.400 gateway (not a Microsoft product). I could not find what the actual type of the ReplyRecipientEntries is supposed to be anywhere on MSDN, but a few C++ code samples online seemed to indicate that the string must be converted into a binary representation.
(Writing the ReplyRecipientNames as a String8 seems to work ok )(both of these must be written into the message properties).
There are several options for the TneftPropertyType but it's not clear which one to use in this case. Grateful for any help. If you need any more info please ask.