function imap_show_messageByID($msg_id) { $imap = new IMAP(); if ($imap->open('david.touzeau', '180872', '127.0.0.1', '143')) { $hash = $imap->DecodeMessage($msg_id, $_GET["f"]); $content = $hash[1]; $subject = $hash[2]; if (preg_match('#<BODY(.*?)>(.+?)</BODY>#is', $content, $re)) { $content = $re[2]; } $html = "\n\t\t\t<br>\n\t\t\t\n\t\t\t<table style='width:100%;border:1px dotted #CCCCCC;padding:5px;margin-top:5px'>\n\t\t\t<tr>\n\t\t\t<th width=1% align='right'><strong>{from}:</strong></th>\n\t\t\t<th width=99%><strong>{$hash[4]}</strong></th>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t<th width=1% align='right'><strong>{date}:</strong></th>\n\t\t\t<th><strong>{$hash[3]}</strong></th>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t<th width=1% align='right'><strong>{subject}:</strong></th>\n\t\t\t<th width=99%><strong>{$subject}</strong></th>\n\t\t\t</tr>\t\t\t\n\n\n\t\t\t<tr>\n\t\t\t<td colspan=2 style='padding-top:10px'>{$content}</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); } }