email body detection improvments

This commit is contained in:
Cipa 2017-12-08 07:17:07 -08:00
parent 708962647c
commit 382d7001e1

View File

@ -174,13 +174,17 @@ $messages = $MyMbox->get($sortOrderArr);
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
<td></td>
<td colspan="4">
<?php
if (isset($structure->parts)) {
echo $structure->parts[0]->body;
}else{
echo $structure->body;
}
?>
<?php if (isset($structure->body)): ?>
<?php echo $structure->body ?>
<?php elseif(isset($structure->parts[1]->body)): ?>
<?php echo $structure->parts[1]->body ?>
<?php elseif(isset($structure->parts[0]->body)): ?>
<?php echo htmlentities($structure->parts[0]->body) ?>
<?php else: ?>
<?php echo '<div class="alert alert-warning" role="alert">
No valid body found
</div>' ?>
<?php endif; ?>
<hr>
<p><a class="btn btn-primary" data-toggle="collapse" href="#email-<?php echo $data['num'];?>" aria-expanded="false" aria-controls="email-<?php echo $data['num'];?>">Raw source</a></p>
<div class="collapse" id="email-<?php echo $data['num'];?>"><pre><?php echo $message;?></pre></div>