-echo '<table width="100%" cellpadding="3" cellspacing="3" align="center"'.
- ' border="0" bgcolor="'.$color[4].'">';
-echo '<tr><td>'.$messagebody.'</td></tr>';
-echo '<tr><td>'.formatAttachments($message,$ent_ar,$mailbox, $passed_id).'</td></tr>';
+echo '<table width="100%" cellpadding="0" cellspacing="5" 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>'.$messagebody. '</td></tr>';
+echo ' </table></td></tr>';
+echo ' </table>';
+echo ' </td></tr>';
+
+$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
+if ($attachmentsdisplay) {
+ 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="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
+ echo ' <tr><td ALIGN="left" bgcolor="'.$color[9].'">';// colspan="5"><b>';
+ echo _("Attachments").':</b></td></tr><tr><td>';
+ echo ' <table width="100%" cellpadding="2" cellspacing="2" align="center"'.' border="0" bgcolor="'.$color[12].'">';
+ echo $attachmentsdisplay;
+ echo ' </td></tr></table></table></td></tr>';
+ echo ' </table></td></tr>';
+ echo ' </table>';
+ echo ' </td></tr>';
+}