function formatMailPart($part) { if ($part instanceof ezcMail) { return formatMail($part); } if ($part instanceof ezcMailText) { return formatMailText($part); } if ($part instanceof ezcMailFile) { return formatMailFile($part); } if ($part instanceof ezcMailRfc822Digest) { return formatMailRfc822Digest($part); } if ($part instanceof ezcMailMultiPart) { return formatMailMultipart($part); } die("No clue about the " . get_class($part) . "\n"); }
<pre><font size="4"><?php require 'ezc-setup.php'; require 'mail-parse2b.php'; $set = new ezcMailFileSet(array(dirname(__FILE__) . "/mail-example.mail")); $parser = new ezcMailParser(); $mail = $parser->parseMail($set); echo htmlspecialchars(formatMail($mail[0]));