include("../functions/display_messages.php");
if (!isset($auth_php))
include ("../functions/auth.php");
+ if (!isset($plugin_php))
+ include ("../functions/plugin.php");
include("../src/load_prefs.php");
global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
$reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc;
- $send_to = decodeHeader($send_to);
- $send_to_cc = decodeHeader($send_to_cc);
+ $send_to = stripslashes(decodeHeader($send_to));
+ $send_to_cc = stripslashes(decodeHeader($send_to_cc));
if ($forward_id)
$id = $forward_id;
else if ($reply_id)
$id = $reply_id;
+
if ($id) {
sqimap_mailbox_select($imapConnection, $mailbox);
$message = sqimap_get_message($imapConnection, $id, $mailbox);
- $message = getEntity($message, $ent_num);
+ $orig_header = $message->header;
+ if ($ent_num)
+ $message = getEntity($message, $ent_num);
if ($message->header->type0 == "text" || $message->header->type1 == "message") {
- $body = decodeBody(mime_fetch_body($imapConnection, $id, $message->header->entity_id), $message->header->encoding);
+ if ($ent_num)
+ $body = decodeBody(mime_fetch_body($imapConnection, $id, $ent_num), $message->header->encoding);
+ else
+ $body = decodeBody(mime_fetch_body($imapConnection, $id, 1), $message->header->encoding);
} else {
$body = "";
}
- if ($forward_id)
- $tmp = _("-------- Original Message ---------\n");
if ($message->header->type1 == "html")
$body = strip_tags($body);
$body_ary = explode("\n", $body);
$body = "";
for ($i=0; $i < count($body_ary); $i++) {
- $tmp = $body_ary[$i];
-
+ if ($i==0 && $forward_id) {
+ $tmp = "-------- " . _("Original Message") . " --------\n";
+ $tmp .= _("Subject") . ": " . $orig_header->subject . "\n";
+ $tmp .= " " . _("From") . ": " . $orig_header->from . "\n";
+ $tmp .= " " . _("To") . ": " . $orig_header->to[0] . "\n";
+ if (count($orig_header->to) > 1) {
+ for ($x=1; $x < count($orig_header->to); $x++) {
+ $tmp .= " " . $orig_header->to[$x] . "\n";
+ }
+ }
+ $tmp .= "\n" . $body_ary[$i];
+ } else {
+ $tmp = $body_ary[$i];
+ }
if ($forward_id)
$body = "$body$tmp\n";
else
$body = "$body> $tmp\n";
}
-
+ return $body;
}
+ $send_to = stripslashes($send_to);
+
if (!$send_to) {
$send_to = sqimap_find_email($send_to);
}
-// $send_to = ereg_replace("\"", "", $send_to);
- $send_to = stripslashes($send_to);
-
/** This formats a CC string if they hit "reply all" **/
if ($send_to_cc != "") {
$send_to_cc = ereg_replace(";", ",", $send_to_cc);
echo " <input type=submit name=\"html_addr_search\" value=\""._("Addresses")."\">";
}
echo "\n <INPUT TYPE=SUBMIT NAME=send VALUE=\"". _("Send") . "\">\n";
+
+ do_hook("compose_button_row");
+
echo " </TD>\n";
echo " </TR>\n\n";
// echo " <INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\"\n";
// echo " value=\"10000\">\n";
echo " <INPUT NAME=\"attachfile\" TYPE=\"file\">\n";
- echo " <input type=\"submit\" name=\"attach\"\n";
- echo " value=\"" . _("Add") ."\">\n";
+ echo " <input type=\"submit\" name=\"attach\"";
+ echo " value=\"" . _("Add") ."\">\n";
echo " </td>\n";
echo " </tr>\n";
if (isset($attachments) && count($attachments)>0) {
checkInput(true);
showInputForm();
+ sqimap_logout($imapConnection);
}
} else if ($html_addr_search_done) {
is_logged_in();
$newmail = true;
newMail();
showInputForm();
+ sqimap_logout($imapConnection);
}
?>