Email message with subject line having latin characters fail to load (Subject line - Fax ServerC_ÿ) RRS feed

  • Question

  • I have an email message which has this latin characters and when I try to do findItems, it fails to find items because of the parse error. but when I remove ItemSchema.Subject from the property set, findItems call gets the items, but now the issue is that I cannot load FirstClassProperties to get the email details like Subject etc, as it will fail to load the email.

    This is the case even when I load and ItemAttachment which has these characters in the body or subject line, I cannot load the itemAttachment. Does anyone encountered the same issue? Please help.

    try { ItemView view = new ItemView(Integer.MAX_VALUE); //need to process the oldest first. view.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Ascending); view.setPropertySet(new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject, ItemSchema.DateTimeReceived));

    FindItemsResults<Item> emailMessages = service.findItems(inbox.getId(), view);// this fails with no results.

    even after I try to load the item for subject line it fails

    try {
    			PropertySet prop = new PropertySet(BasePropertySet.FirstClassProperties);
    			item.load(prop);// it fails here
    			String subject = item.getSubject();

    any suggestions?

    Friday, April 14, 2017 5:22 PM