Question

I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of text/html from an email (if it exists) for further processing.

The "text/html" could exist inside other content such as multipart/alternative, so I'm trying to find out if there is a defined hierarchy for email MIME Types.

Anybody know if there is and what it is? i.e. what types can parent other types?

Was it helpful?

Solution

In theory, only multipart/ and message/ can parent other types (per RFC2046).

OTHER TIPS

Your question assumes that mail clients follow the RFC standards for MIME encoding, which they don't. I'd advise you collect a bunch of mail from sources and try and process it as-it-exists. The problem you are facing is extremely difficult (perhaps impossible) to solve 100%.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top