4c9f5c312cb984f7c625c77095b55b592aa2361e
2 if (!isset($config_php))
3 include("../config/config.php");
4 if (!isset($strings_php))
5 include("../functions/strings.php");
6 if (!isset($page_header_php))
7 include("../functions/page_header.php");
9 include("../functions/imap.php");
10 if (!isset($mime_php))
11 include("../functions/mime.php");
12 if (!isset($date_php))
13 include("../functions/date.php");
15 include("../src/load_prefs.php");
17 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
18 sqimap_mailbox_select($imapConnection, $mailbox);
20 // $message contains all information about the message
21 // including header and body
22 $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
25 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
26 displayPageHeader($color, $mailbox);
28 /** translate the subject and mailbox into url-able text **/
29 $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"])));
30 $urlMailbox = urlencode($mailbox);
31 $url_replyto = urlencode($message["HEADER"]["REPLYTO"]);
33 $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]);
34 $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"]));
36 $dateString = getLongDateString($message["HEADER"]["DATE"]);
38 /** TEXT STRINGS DEFINITIONS **/
39 $echo_more = _("more");
40 $echo_less = _("less");
42 /** FORMAT THE TO STRING **/
45 $to_ary = $message["HEADER"]["TO"];
46 while ($i < count($to_ary)) {
47 $to_ary[$i] = htmlspecialchars($to_ary[$i]);
49 $to_string = "$to_string<BR>$to_ary[$i]";
51 $to_string = "$to_ary[$i]";
54 if (count($to_ary) > 1) {
55 if ($show_more == false) {
57 $to_string = "$to_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
61 $to_string = "$to_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
66 /** FORMAT THE CC STRING **/
69 $cc_ary = $message["HEADER"]["CC"];
70 while ($i < count($cc_ary)) {
71 $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
73 $cc_string = "$cc_string<BR>$cc_ary[$i]";
75 $cc_string = "$cc_ary[$i]";
78 if (count($cc_ary) > 1) {
79 if ($show_more_cc == false) {
81 $cc_string = "$cc_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
85 $cc_string = "$cc_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
90 /** make sure everything will display in HTML format **/
91 $from_name = htmlspecialchars(decodeHeader($message["HEADER"]["FROM"]));
92 $subject = htmlspecialchars(decodeHeader(stripslashes($message["HEADER"]["SUBJECT"])));
95 echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
96 echo " <TR><TD BGCOLOR=\"$color[0]\" WIDTH=100%>";
97 echo " <TABLE WIDTH=100% CELLSPACING=0 BORDER=0 COLS=2 CELLPADDING=3>";
99 echo " <TD ALIGN=LEFT WIDTH=50%>";
101 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
102 echo _("Message List");
103 echo "</A> | ";
104 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">";
106 echo "</A> ";
108 echo " </TD><TD WIDTH=50% ALIGN=RIGHT>";
110 echo " <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">";
112 echo "</A> | ";
113 echo " <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
115 echo "</A> | ";
116 echo " <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
118 echo "</A> ";
124 echo " <TR><TD CELLSPACING=0 WIDTH=100%>";
125 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=3>\n";
128 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
130 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
131 echo " <B>$subject</B>\n";
136 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
138 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
139 echo " <B>$from_name</B>\n";
144 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
146 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
147 echo " <B>$dateString</B>\n";
152 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
154 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
155 echo " <B>$to_string</B>\n";
159 if ($message["HEADER"]["CC"][0]) {
161 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
163 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
164 echo " <B>$cc_string</B>\n";
171 echo " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
172 $body = formatBody($message, $color, $wrap_at);
177 echo " </TD></TR>\n";
178 echo " <TR><TD BGCOLOR=\"$color[9]\"> </TD></TR>";