echo " </TR></TABLE>\n";
echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
echo " <TD ALIGN=left WIDTH=70%>";
- echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>  ";
+ $urlMailbox = $mailbox;
+ echo " <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A>  ";
echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>  ";
echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>  ";
echo " <A HREF=\"options.php\">" . _("Options") . "</A>  ";
return $err_num;
}
- function sendMessage($t, $c, $b, $subject, $body) {
- global $useSendmail, $msg_id, $is_reply;
+ function sendMessage($t, $c, $b, $subject, $body, $reply_id) {
+ global $useSendmail, $msg_id, $is_reply, $mailbox;
global $data_dir, $username, $domain, $key, $version, $sent_folder, $imapServerAddress, $imapPort;
+ $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
+ if ($reply_id) {
+ sqimap_mailbox_select ($imap_stream, $mailbox);
+ sqimap_messages_flag ($imap_stream, $reply_id, $reply_id, "Answered");
+ }
+
if ($useSendmail==true) {
$length = sendSendmail($t, $c, $b, $subject, $body);
} else {
$length = sendSMTP($t, $c, $b, $subject, $body);
}
- $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
if (sqimap_mailbox_exists ($imap_stream, $sent_folder)) {
sqimap_append ($imap_stream, $sent_folder, $length);
write822Header ($imap_stream, $t, $c, $b, $subject);
global $send_to, $send_to_cc, $reply_subj, $forward_subj, $body,
$passed_body, $color, $use_signature, $signature, $editor_size,
$attachments, $subject, $newmail, $use_javascript_addr_book,
- $send_to_bcc;
+ $send_to_bcc, $reply_id, $mailbox;
$subject = decodeHeader($subject);
$reply_subj = decodeHeader($reply_subj);
}
echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
+ if ($reply_id) {
+ echo "<input type=hidden name=reply_id value=$reply_id>\n";
+ }
+ echo "<input type=hidden name=mailbox value=$mailbox>\n";
echo "<TABLE COLS=2 WIDTH=50 ALIGN=center CELLSPACING=0 BORDER=0>\n";
echo " <TR>\n";
echo " <TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
if(isset($send)) {
if (checkInput(false)) {
- sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
- header ("Location: right_main.php");
+ $urlMailbox = urlencode ($mailbox);
+ sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id);
+ header ("Location: right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=1");
} else {
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);