PHP Classes

HTML Emails

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  HTML Emails  >  (Un) Subscribe thread alerts  
Subject:HTML Emails
Summary:I have a problem getting the body from html emails
Messages:2
Author:Jesper Christiansen
Date:2007-01-24 16:22:40
Update:2007-01-25 00:16:38
 

  1. HTML Emails   Reply   Report abuse  
Picture of Jesper Christiansen Jesper Christiansen - 2007-01-24 16:22:40
Hi..

I have a problem getting the body text from HTML emails? How do I do that?

TO retrieve the normal body text i just use $decoded[$i]["Parts"][0]["Body"]; - but that one doesnt exist or is empty when its html..

what should i do?

Thanks a lot in advance!!

  2. Re: HTML Emails   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-01-25 00:16:38 - In reply to message 1 from Jesper Christiansen
HTML email usually are composed as multipart/alternative messages that contain both a plain text and an HTML part. You need to check if the content-type header is multipart/alternative. In that case you need to look at the parts contained in that multipart part.

In the future the class will provide a simpler way to find message parts in the most common message structures.