Web Hosting Talk







View Full Version : Given a multi-mime email message, how to extract only the HTML?


Rahil
01-09-2008, 02:53 AM
I am working on a custom mailing list script and I just need help with one last thing.

I am sending an email with Thunberbird in a multi-mime format (plain text and HTML). If I look at the message source, there are the headers, the plain text email, and then the HTML email. How do I extract only the HTML part?

I was thinking of using preg_match to find the line that has <html> and the line that has </html>, but I'm not sure how exactly to do that.

Any tips/advice? Thanks guys!

mylinear
01-09-2008, 07:59 AM
I do not have specific details, but this may help.

http://pear.php.net/package/Mail_mimeDecode/