I have a requirement to get the content of a email body. When I am using item.getBody().toString() method, I am getting output in HTML format , but i wanted body to be in text format. I found C# code in website but i don't know how that could be converted to java.
I have tried below approach but didn't work as expected.
PropertySet bindPropSet = new PropertySet(BasePropertySet.FirstClassProperties , EmailMessageSchema.Body);
bindPropSet.getRequestedBodyType();
BodyType body = BodyType.Text;
LOGGER.info(BodyType.Text);
Below is the C# code
PropertySet BindPropSet = new PropertySet(BasePropertySet.FirstClassProperties);
BindPropSet.RequestedBodyType = BodyType.Text;
Item itm = Item.bind(service, itemId, BindPropSet);