Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Getting rid of HTML in POP3Client

by McD (Chaplain)
on Dec 27, 2002 at 14:33 UTC ( [id://222540]=note: print w/replies, xml ) Need Help??


in reply to Getting rid of HTML in POP3Client

I'm not 100% sure what your eventual goal is, so I'll speak in general terms.

Most HTML mail is made up of one or more MIME attachments. The MIME::Tools suite that an earlier poster mentioned will let you take those apart and look at the pieces.

MIME messages contain entities, each of which in turn can contain their own entities. A single entity is something like text, or a picture, or a binary attachment of some sort. Usually, the HTML attachment is a single entity.

Having used MIME::Tools to break your message down into a collection of entities, you can use the HTML modules another poster mentioned to construct just the formatted text from an HTML entity.

At that point, it gets a little tricky. What will you do with this formatted text? Replace the HTML entity with an entity of type text/plain? Turn the root entity into a multipart/alternative message and attach your new text/plain entity as an alternate? What if there already was an alternate? What if there's more than one HTML entity? What if this wasn't a MIME message, but just a plain old mail message which happened to contain HTML?

(Or maybe you just want to do some processing on the text and leave the mail unchanged, I don't know.)

All kinds of things are possible, but you need to ramp up a little on MIME messages (and how Outlook will process them) before you can really make an informed decision. O'Reilly's Programming Internet Email is a great resource for this.

Peace,
-McD

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://222540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found