views:

27

answers:

1

I'm working with emails and want to display the html in the browser, I'm not sure how to deal with the encoding. I want to extract the html to display it in the html browser. The way I plan on doing this is using an html parser on the entire email parsing the data inbetween the tags in the html section. Is there an easier/more efficient way to do this?

Here's text encoding

------=_Part_29856965_540743623.1285814590176 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

Here's the html encoding

------=_Part_29856965_540743623.1285814590176 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

A: 

You can have a look at the ezComponents - Mail component. It has a lot of operations for building and using a MIME

http://ezcomponents.org/docs/tutorials/Mail

etbal
I'm not building, I'm reading an email and trying to extract the body - would this still work?
Bob Cavezza
yes, you can create a MIME object from the email text. Through that object you can return the encoding - http://ezcomponents.org/docs/api/trunk/Mail/ezcMailPart.html#methodgetHeader
etbal
Well, I'm not trying to create a MIME object. I'm trying to extract the html from the email message in a string format.
Bob Cavezza