You first need to save the ResponseMessage
in the Drafts
folder via the Save()
method and then you can obtain an instance of the EmailMessage
. This is the same pattern used to add attachments to message replies.
var message = (EmailMessage) Item.Bind(service, new ItemId(uniqueId), PropertySet.FirstClassProperties);
var reply = message.CreateReply(false);
reply.BodyPrefix = "Response text goes here";
var replyMessage = reply.Save(WellKnownFolderName.Drafts); // default is drafts folder - this is explicit
replyMessage.SetExtendedProperty(_redFlag, "test");
replyMessage.Update(ConflictResolutionMode.AlwaysOverwrite);
replyMessage.SendAndSaveCopy();