witam...
chcę pobrać wiadomość w postaci html aby wyeksportować ją do pliku html - pętelka
robię tak. sprawdzam czy to wiadomość prosta czy złożona - sprawdzam strukturę i wtedy pobieram i odpowiednio wyświetlam wiadomość lecz wyświetla się czysty tekst... natomiast gdy pokombinuję inaczej... to wyświetla ale nie wszystko, lub nie interpretuje wszystkich tagów/ stylów

  1. function check_str(&$structure){
  2. $type = array('TEXT', 'MULTIPART', 'MESSAGE', 'APPLICATION', 'AUDIO', 'IMAGE', 'VIDEO', 'OTHER');
  3. if($structure->subtype){
  4. return $type[(int) $structure->type] . '/' . $structure->subtype;
  5. }
  6. return 'TEXT/PLAIN';
  7. }

  1. function wiadomosc($uchwyt, $mid, $type, $structure = 0, $part_number = 0){
  2. if(!$structure){
  3. $structure = imap_fetchstructure($uchwyt, $mid);
  4. }
  5.  
  6. if($type == check_str($structure)){
  7. if(!$part_number){
  8. $part_number = '1';
  9. }
  10. $text = imap_fetchbody($uchwyt, $mid, $part_number);
  11. if($structure->encoding == 4){
  12. return imap_qprint($text);
  13. }elseif($structure->encoding == 3){
  14. return imap_base64($text);
  15. }else{
  16. return $text;
  17. }
  18. }
  19. if($structure->type == 1){
  20. while(list($index, $p_structure) = each($structure->parts)){
  21. if($part_number){
  22. $prefix = $part_number . '.';
  23. }
  24. $data = wiadomosc($uchwyt, $mid, $type, $p_structure, $prefix . ($index + 1));
  25. if($data){
  26. return $data;
  27. }
  28. }
  29. }
  30.  
  31. return 0;
  32. }

i zwraca mi zawsze ładnie rozkodowany tekst ale bez html ;(
NIE WIEM tracę już głowę - zawsze tak jest winksmiley.jpg