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

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

\n"; $ms->loadFromString(file_get_contents($mailFolder . '/' . $_GET['mail'])); /** @var WBMail_Mime */ $mail = $ms->getMimeMail(); echo "From: " . htmlspecialchars($mail->getFrom()->get()) . "
\n"; echo "To: " . htmlspecialchars($mail->getRcpt()->get()) . "
\n"; 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"; }