EWS body plain text

后端 未结 5 1240
盖世英雄少女心
盖世英雄少女心 2020-12-05 06:47

I use EWS to get exchange emails, but how can i get plain text from email body, without html?
Now i use this:

EmailMessage item = (EmailMessage)outbox         


        
5条回答
  •  自闭症患者
    2020-12-05 07:47

    I had the same issue. All you have to do is set RequestedBodyType property of the property set you are using.

        PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, EmailMessageSchema.Subject, EmailMessageSchema.Body);
        propSet.RequestedBodyType = BodyType.Text;
        var email = EmailMessage.Bind(service, item.Id, propSet);
    

提交回复
热议问题