$pop3->authentication_mechanism = "USER"; /* SASL authentication mechanism */ $pop3->debug = 1; /* Output debug information */ $pop3->html_debug = 1; /* Debug information is in HTML */ $pop3->join_continuation_header_lines = 1; /* Concatenate headers split in multiple lines */ if (($error = $pop3->Open()) == "") { echo "<PRE>Connected to the POP3 server "" . $pop3->hostname . "".</PRE>\n"; if (($error = $pop3->Login($user, $password, $apop)) == "") { echo "<PRE>User "{$user}" logged in.</PRE>\n"; if (($error = $pop3->Statistics($messages, $size)) == "") { echo "<PRE>There are {$messages} messages in the mail box with a total of {$size} bytes.</PRE>\n"; if ($messages > 0) { $pop3->GetConnectionName($connection_name); $message = 1; $message_file = 'pop3://' . $connection_name . '/' . $message; $mime = new mime_parser_class(); /* * Set to 0 for not decoding the message bodies */ $mime->decode_bodies = 1; $parameters = array('File' => $message_file, 'SkipBody' => 1); $success = $mime->Decode($parameters, $decoded); if (!$success) { echo '<h2>MIME message decoding error: ' . HtmlSpecialChars($mime->error) . "</h2>\n"; } else { echo '<h2>MIME message decoding successful</h2>' . "\n"; echo '<h2>Message structure</h2>' . "\n"; echo '<pre>';