This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mail body coming with HTML tags

 
SoumyaGh Ghosh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a scenario of using java mail api as below:
I am reading Outlook/exchange server using java mail IMAP. The message bodies (including the cases which are of content type text/html) I am saving in local DB. But those contents are coming within <html> tags with all it's styles etc. These are nothing but the view source content of the mail bodies of outlook mails. I have to create one window for showing, replying the mails from my own application. So when I am showing those mail bodies within a text area from my jsp page, contents are showing with <html> tags, for that it's not possible to read the exact mail body contents. Also as there are features to reply or forward those mails, for that I need to provide text area support so that user can type further contents. Can anyone please suggest any idea how can I show only the mail bodies without html tags. Is there any option to provide html support for textarea contents? or I have to set specific content type at the type of mail reading from exchange server?
 
Pankaj Kr. Singh
Ranch Hand
Posts: 32
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi SoumyaGh,

Use the MimeBodyPart and use the Input stream and read the message and save where ever you need to save

For example


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic