-echo '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0">';
-echo ' <tr><td>';
-echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">';
-echo ' <tr><td>';
-echo ' <table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
-echo ' <tr bgcolor="'.$color[4].'"><td>';
-// echo ' <table cellpadding="1" cellspacing="5" align="left" border="0">';
-echo html_tag( 'table' ,'' , 'left', '', 'width="100%" cellpadding="1" cellspacing="5" border="0"' );
-echo ' <tr>' . html_tag( 'td', '<br />'. $messagebody."\n", 'left')
- . '</tr>';
-echo ' </table>';
-echo ' </td></tr>';
-echo ' </table></td></tr>';
-echo ' </table>';
-echo ' </td></tr>';
-
-echo '<tr><td height="5" colspan="2" bgcolor="'.
- $color[4].'"></td></tr>'."\n";
-
-$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
-if ($attachmentsdisplay) {
- echo ' </table>';
- echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
- echo ' <tr><td>';
- echo ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
- echo ' <tr>' . html_tag( 'td', '', 'left', $color[9] );
- echo ' <b>' . _("Attachments") . ':</b>';
- echo ' </td></tr>';
- echo ' <tr><td>';
- echo ' <table width="100%" cellpadding="2" cellspacing="2" align="center"'.' border="0" bgcolor="'.$color[0].'"><tr><td>';
- echo $attachmentsdisplay;
- echo ' </td></tr></table>';
- echo ' </td></tr></table>';
- echo ' </td></tr>';
- echo '<tr><td height="5" colspan="2" bgcolor="'.
- $color[4].'"></td></tr>';
-}
-echo '</table>';
+
+$oTemplate->assign('message_body', $messagebody);
+$oTemplate->display('read_message_body.tpl');
+
+formatAttachments($message,$ent_ar,$mailbox, $passed_id);