您必须先加载或分配此属性,然后才能阅读它

时间:2019-06-10 12:55:27

标签: c# exchange-server exchangewebservices

我正在尝试从电子邮件中获取“ uniqueBody”,但出现上述错误。我只有在尝试读取uniqueBody时才收到此错误,只是使身体正常工作

我尝试使用'Load()'方法,但是没有用。.

FindItemsResults<Item> findResults = exchange.FindItems(WellKnownFolderName.Inbox, filter, new ItemView(50));

            foreach (Item item in findResults)
            {                   
                EmailMessage message = EmailMessage.Bind(exchange, item.Id);
                sB.Append("<strong>Email:</strong> " + message.From.Address.ToString() + "<BR />");
                sB.Append("<strong>Requestor:</strong> " + message.From.Name.ToString() + "<BR />");
                sB.Append("<strong>Subject:</strong> " + message.Subject.ToString() + "<BR />");
                sB.Append("<strong>Body:</strong> " + message.Body.ToString() + "<BR />");

                //message.Load();
                uniqueBody = message.UniqueBody.ToString(); //THIS BREAKS

<SNIP>

1 个答案:

答案 0 :(得分:0)