title: How to get email body using EWS?
body: <p>I'm getting emails from Outlook Inbox to display on an Email Search Screen, based on filters (Sender, Subject, Message).</p>
  
  <p>I'm able to get all but the body of the E-mail:</p>
  
  <p><strong>OutlookRepository.cs:</strong></p>
  
  <pre><code>public FindItemsResults&lt;Item&gt; GetEmails(string loginUsuario, string de, string assunto, string conteudo, WellKnownFolderName pasta = WellKnownFolderName.Inbox)
          {
              ExchangeService service = GetExchangeService(loginUsuario);
  
              var inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
  
              SearchFilter sf = null;
  
              // Search by Sender
              if (!string.IsNullOrWhiteSpace(de))
                  sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.ContainsSubstring(EmailMessageSchema.From, de));
  
              // Search by Subject
              if (!string.IsNullOrWhiteSpace(assunto))
                  sf = new SearchFilter.SearchFilterCollection(LogicalOperator.Or, new SearchFilter.ContainsSubstring(EmailMessageSchema.Subject, assunto));
  
              // Search by Body
              if (!string.IsNullOrWhiteSpace(conteudo))
                  sf = new SearchFilter.SearchFilterCollection(LogicalOperator.Or, new SearchFilter.ContainsSubstring(EmailMessageSchema.Body, conteudo));
  
              var view = new ItemView(100);
  
              var emails = service.FindItems(pasta, sf, view);
  
              return emails;
          }
  </code></pre>
  
  <p>On return "emails", Body throws a exception: <strong>Body = '(new System.Linq.SystemCore_EnumerableDebugView(emails).Items[0]).Body' threw an exception of type 'Microsoft.Exchange.WebServices.Data.ServiceObjectPropertyException'</strong></p>
  
  <p><strong>EmailController.cs:</strong></p>
  
  <pre><code>public JsonResult PesquisarEmails(string de, string assunto, string conteudo)
          {
              FindItemsResults&lt;Item&gt; emails = ServiceFactory.GetService&lt;IComunicacaoService&gt;(true).RecuperarEmails(UsuarioAutenticado.Funcionario.Login, de, assunto, conteudo);
  
              var lista = new List&lt;EmailFormatado&gt;();
  
              foreach (Item email in emails)
              {
                  lista.Add(new EmailFormatado()
                  { 
                      DataEmail = email.DateTimeReceived.FormatarDataCompleta(),
                      Remetente = (email as EmailMessage).From.Address,
                      AssuntoEmail = email.Subject,
                      Descricao = email.TextBody
              });
              }
  
              return Json(lista, JsonRequestBehavior.AllowGet);
          }
  </code></pre>
  
  <p>Tryed to use "email.TextBody" and "email.Body" but it's throws a exception: 
  <strong>email.TextBody = 'email.TextBody' threw an exception of type 'Microsoft.Exchange.WebServices.Data.ServiceObjectPropertyException'</strong></p>
  
  <p>Any help?</p>