Exchange Web Services - convert emailitem attachment from Base64 string to Byte gives error

岁酱吖の 提交于 2019-12-02 10:18:40

Philip,

You will not be able to use the Convert() method on an ItemAttachment because it is not Base64 encoded. The item attachment has a lot of properties about the item, and if I understand your request properly you are looking for just the body of the email.

The first thing you will want to consider is adding a check to see if the ItemAttachment is an email message. If it is, there are couple of lines to get to the text of the email body:

itemAttachment.Load(new PropertySet(BasePropertySet.FirstClassProperties));
string BodyText = itemAttachment.Item.Body.Text;

The first line will load the item and it's first class properties. The second line will get the text version of the email body.

I hope this helps. If this does resolve your question, please mark the post as answered.

Thanks,

--- Bob ---

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!