Recently I was writing some C# code to connect to Exchange Web Service and get email attachments. While trying to get “From” email address property, I got an exception “You must load or assign this property before you can read its value”.
The problem is that even when you have the message item, property values are not loaded, and hence can not be read. What you need to do then is call Load() method on message object.
FindItemsResults findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(mailboxPageSize)); foreach (Item item in findResults.Items) { EmailMessage message = EmailMessage.Bind(service, item.Id, new PropertySet(ItemSchema.Attachments)); message.Load(); string fromAddress = message.From.Address; //Do other stuff }