require_once('rfc822_addresses.php');
require_once('mime_parser.php');
require_once('simple_html_dom.php');
$mime = new mime_parser_class;
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$email_number,0);
$message = imap_fetchbody($inbox,$email_number,1);
/* output the email header information */
$output.= '<div class="toggler '.quoted_printable_decode(($overview[0]->seen ? 'read' : 'unread')).'">';
if ($mime->Decode(Array('Data' => 'Subject: '.$overview[0]->subject), $decoded)) {
if ($mime->Analyze($decoded[0], $results)) {
$msg_subject = $results['Subject'];
}
}
$sub = mb_convert_encoding($msg_subject, 'UTF-8', 'KOI8-R');
$from = quoted_printable_decode($overview[0]->from);
$date = quoted_printable_decode($overview[0]->date);
$Sourse_des = $sub;
/* output the email body */
$message = quoted_printable_decode($message);
$html = str_get_html($message);
На здоровье.