>
>
> How many times did you send this message to the list?

Sorry to many... my fault.  I wasn't getting a reply from the list.

>
>
> * "Basil A. Daoust" <[EMAIL PROTECTED]> [2008-06-24T14:59:34]
> > I want to be able to read a MIME encoded email file (Thunderbird) and
> have
> > a way of returning just the VIEWABLE body part.
>
> "Viewable" isn't defined by any RFC.  What do you mean?


What I mean is I want to get what the user sees, when they look at the
email.
NONE of the HTML tags or CCS details etc.  I guess viewable wasn't a good
description.

>
>
> You want something like:
>
>  my $root = Email::MIME->new($message_text);
>  my ($html_part) = grep { $_->content_type =~ m{^text/html} }
> $root->subparts;
>
>  my $encoded_html = $html_part->body;
>  my $html = Encode::decode($charset_from_content_type, $encoded_html);
>
> Thanks, that works though the way you wrote that I thought
"$charset_from_content_type" was a MIME set value when new was run.  Well it
doesn't appear to be, but no problem.

Now this works and so does pulling "Text/plain".  Text plain is what I want,
so when its available great.
I'm guessing that to cleanup text/html, I should use something like
HTML::Parser?

Thanks for the nice clean example.

Reply via email to