Hi all, its me again.
Im trying to display an e-mail body on my site. My code looks like this:
<?php
// If multipart, only display the text
if (is_array($parsed_structure)){
//print "IS ARRAY!";
for ($i = 0; $i<sizeof($parsed_structure); $i++){
print $parsed_structure[$i]["type"]."<br />";
if (($parsed_structure[$i]["type"] == "text/plain" || $parsed_structure[$i]["type"] == "message/rfc822") && $parsed_structure[$i]["disposition"] != "attachment"){
print "<p>";
print htmlspecialchars(stripslashes(trim(imap_fetchbody($inbox, $id, $parsed_structure[$i]["pid"]))));
print "</p";
}else if ($parsed_structure[$i]["type"] == "text/html"){
print "<p>";
print imap_fetchbody($inbox, $id, $parsed_structure[$i]["pid"]);
print "</p>";
} else {
}
}
} else {
print htmlspecialchars(stripslashes(trim(imap_body($inbox, $id))));
}
?>
The print command in my for loop
for ($i = 0; $i<sizeof($parsed_structure); $i++){
print $parsed_structure[$i]["type"]."<br />";
gives me this:
text/0subtype
text/0subtype
text/0subtype
Can anyone please help with how i can display the messeges.
Perhaps provide me with a magical code that displays all types of messages?
Thank you for your time, and effort.
~Gabor