Parse E-Mail File\n"; echo "\n"; if( !isset( $_GET['mail'] ) || empty( $_GET['mail'] ) ) { echo "Select a file to load\n"; exit(); } $ms = WBClass::create('WBMail_Mime_Storage_String'); echo "

Load E-Mail File ". $_GET['mail'] ."

\n"; $ms->loadFromString(file_get_contents($mailFolder . '/' . $_GET['mail'])); $mail = $ms->getMimeMail(); echo "Subject: " . $mail->getSubject() . "
\n"; echo "Text:
" . htmlspecialchars($mail->getPlainBody()) . "
\n"; echo "HTML
" . htmlspecialchars($mail->getHtmlBody()) . "
\n"; echo "

Attachments: " . $mail->countAttachments() . "

\n"; for ($i = 0; $i < $mail->countAttachments(); ++$i ) { $att = $mail->getAttachment($i); echo "
\n"; echo "Name: " . $att->getName() . "
\n"; echo "Mime: " . $att->getMime() . "
\n"; if (0 == strncmp('image/', $att->getMime(), 6)) { echo sprintf('%s', $att->getMime(), base64_encode($att->getData()), $att->getName()); } echo "
\n"; }