I’m trying to provide a way to forward emails, just as we do in Outlook. When the user clicks forward, it opens a form with the original message and header information on top, giving the user an opportunity to modify the body. To get the message, I do the following.
var item = (EmailMessage)dataGridEmail.SelectedItem;
ResponseMessage forward = item.CreateForward();
textBlockForward.Text = forward.Body;
I get an ServiceObjectPropertyException with message “You must load or assign this property before you can read its value”. If I try to load the value of the body property before accessing, I get NotSupportedException with message “Specified method is not supported”. Is there a way to get the forwarding message before actually sending it?
Instead of using
forward.Body, you should useitem.Bodyto populate yourtextBlockForwardcontrol. See Forwarding Email Messages using EWS on MSDN for more details.