0

I use EWS Java API to send mails through Exchange 2010. From the trace I find that content type is set as text/xml. Is there a way to send mails as plain text only?

Content-Type: text/xml

Thanks.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
user1551550
  • 97
  • 1
  • 11

1 Answers1

2

AFAIK the communication through that API goes with SOAP calls and these should have Content-Type=text/xml; charset=utf-8 - without double quotes around utf-8. EWS is quirky about that.

I think that is what you are seeing in your trace.

The trick is to set the BodyType to Best or HTML or Text whenever you use operations like GetItem, UpdateItem.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
  • Hi, i modified the Body type as text. I could find the trace tag. But it still adds a header with Content-type as text/xml...:(:( – user1551550 May 15 '13 at 13:54
  • hi...is there a way to edit the headers added by the EWS API?? – user1551550 May 16 '13 at 11:07
  • I don't know anything about the EWS Java API, you'd have to 'dive under the hood' as far as you can see code. I'm coding raw SOAP calls from Delphi and there I have full control over the components that handle the HTTP requests/responses. They have an OnBeforePost handler where I can insert stuff like: " HttpAddRequestHeaders(Data, PChar(cContentHeader), Length(cContentHeader), HTTP_ADDREQ_FLAG_REPLACE); ", with cContentHeader = 'Content-Type: text/xml; charset=utf-8'; – Jan Doggen May 16 '13 at 13:56