";
+ echo " ";
+
+ echo "";
+ echo " | ";
+
+ if ($type1 != "html")
+ translateText($body, $wrap_at, $charset);
+
+ echo $body;
echo " | ";
}
@@ -63,6 +75,7 @@
$header = $message->header;
$body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id);
+ $charset = $header->charset;
$type0 = $header->type0;
$type1 = $header->type1;
$filename = decodeHeader($header->filename);
@@ -95,20 +108,21 @@
switch($type0) {
case "text":
$body = decodeBody($body, $header->encoding);
- header("Content-type: application/octet-stream; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
+ header("Content-type: application/octet-stream; name=\"$filename\"");
+ set_up_language(getPref($data_dir, $username, "language"));
if ($type1 == "plain") {
- echo _("Subject") . ": " . decodeHeader(stripslashes($top_header->subject)) . "\n";
- echo " " . _("From") . ": " . decodeHeader(stripslashes($top_header->from)) . "\n";
- echo " " . _("To") . ": " . decodeHeader(stripslashes(getLineOfAddrs($top_header->to))) . "\n";
+ echo _("Subject") . ": " . decodeHeader(sqStripSlashes($top_header->subject)) . "\n";
+ echo " " . _("From") . ": " . decodeHeader(sqStripSlashes($top_header->from)) . "\n";
+ echo " " . _("To") . ": " . decodeHeader(sqStripSlashes(getLineOfAddrs($top_header->to))) . "\n";
echo " " . _("Date") . ": " . getLongDateString($top_header->date) . "\n\n";
}
echo trim($body);
break;
default:
$body = decodeBody($body, $header->encoding);
- header("Content-type: application/octet-stream; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
+ header("Content-type: application/octet-stream; name=\"$filename\"");
echo $body;
break;
}
@@ -116,20 +130,23 @@
switch ($type0) {
case "text":
$body = decodeBody($body, $header->encoding);
+ include("../functions/page_header.php");
viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at);
break;
case "message":
$body = decodeBody($body, $header->encoding);
+ include("../functions/page_header.php");
viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1, $wrap_at);
break;
default:
$body = decodeBody($body, $header->encoding);
- header("Content-type: $type0/$type1; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
+ header("Content-type: $type0/$type1; name=\"$filename\"");
echo $body;
break;
}
}
+ sqimap_mailbox_close($imapConnection);
sqimap_logout($imapConnection);
?>
|