exchangewebservices - Send string content with special characters in email using EWS Java API -


i tried send 'string' content in email using ews java api:

<root>  <tag1>text1</tag1>  <tag2>text2</tag2> </root> 

the code used is:

string msg = content given above; exchangeservice service = new exchangeservice(); exchangecredentials credentials = new webcredentials(user, password); service.setcredentials(credentials); try {     service.seturl(new java.net.uri(exchangeurl));     service.settraceenabled(true);     emailmessage message = new emailmessage(service);     message.setsubject(mail_sub);     message.setfrom(fromaddress);     message.setbody(new messagebody(msg));     message.gettorecipients().add("emailaddress");                  message.send(); } 

but email content as:

text 1 text 2

how solve this? using exchange 2010 , ews java api 1.2.

i used

message.setbody(messagebody.getmessagebodyfromtext(msg)); bodytype type = bodytype.text; message.getbody().setbodytype(type); 

and solved problem...:):):)

thanks.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -