Actionmailer whoes

Im pulling some emails off of a server, parsing them with TMail and
looping through them in the view and displaying them. My problem is
that I want to display the html emails I have but when I put them on the
page the and tags of the email Im importing are being
injected into my sites html and body tags, which leads to some extremely
weird results. If I escape the html via h @mail.body_html, I of course
get a garbled mess. Any ideas on how to cut out these tags properly?

On Wed, Jul 29, 2009 at 4:24 PM, Dan
Dunn[email protected] wrote:

Im pulling some emails off of a server, parsing them with TMail and
looping through them in the view and displaying them. My problem is
that I want to display the html emails I have but when I put them on the
page the and tags of the email Im importing are being
injected into my sites html and body tags, which leads to some extremely
weird results. If I escape the html via h @mail.body_html, I of course
get a garbled mess. Any ideas on how to cut out these tags properly?

Use something like hpricot to (short version) get the innerHTML of
the BODY element of the email.

The doc/examples are pretty straightforward, but post back if you
have problems with it.

HTH,

Hassan S. ------------------------ [email protected]
twitter: @hassan