简体   繁体   English

通过ews-java-api获取TextBody以获取电子邮件

[英]Get TextBody for an email through the ews-java-api

It seems not to be possible to get email body as plain text if there is some in mime encoded mail. 如果mime编码的邮件中有些邮件,则似乎无法将电子邮件正文作为纯文本发送。 How to work around it? 如何解决呢?

I solved the problem. 我解决了问题。 When you get the item ExchangeService.bindToItem(EmailMessage.class, itemId, PROPERTY_SET_TEXT_BODY).getBody() use need use following property set and then set request body type to BodyType.Text 当您获取商品ExchangeService.bindToItem(EmailMessage.class, itemId, PROPERTY_SET_TEXT_BODY).getBody()需要使用以下属性集,然后将请求正文类型设置为BodyType.Text

PropertySet PROPERTY_SET_TEXT_BODY = new PropertySet(ItemSchema.Body);
PROPERTY_SET_TEXT_BODY.setRequestedBodyType(BodyType.Text);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM