2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
6 include("../functions/mime.php");
7 include("../functions/date.php");
9 include("../src/load_prefs.php");
11 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
12 sqimap_mailbox_select($imapConnection, $mailbox);
14 // $message contains all information about the message
15 // including header and body
16 $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
19 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
20 displayPageHeader($color, $mailbox);
22 /** translate the subject and mailbox into url-able text **/
23 $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"])));
24 $urlMailbox = urlencode($mailbox);
25 $url_replyto = urlencode($message["HEADER"]["REPLYTO"]);
27 $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]);
28 $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"]));
30 $dateString = getLongDateString($message["HEADER"]["DATE"]);
32 /** TEXT STRINGS DEFINITIONS **/
33 $echo_more = _("more");
34 $echo_less = _("less");
36 /** FORMAT THE TO STRING **/
39 $to_ary = $message["HEADER"]["TO"];
40 while ($i < count($to_ary)) {
41 $to_ary[$i] = htmlspecialchars($to_ary[$i]);
43 $to_string = "$to_string<BR>$to_ary[$i]";
45 $to_string = "$to_ary[$i]";
48 if (count($to_ary) > 1) {
49 if ($show_more == false) {
51 $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>)";
55 $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>)";
60 /** FORMAT THE CC STRING **/
63 $cc_ary = $message["HEADER"]["CC"];
64 while ($i < count($cc_ary)) {
65 $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
67 $cc_string = "$cc_string<BR>$cc_ary[$i]";
69 $cc_string = "$cc_ary[$i]";
72 if (count($cc_ary) > 1) {
73 if ($show_more_cc == false) {
75 $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>)";
79 $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>)";
84 /** make sure everything will display in HTML format **/
85 $from_name = htmlspecialchars($message["HEADER"]["FROM"]);
86 $subject = htmlspecialchars(stripslashes($message["HEADER"]["SUBJECT"]));
89 echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
90 echo " <TR><TD BGCOLOR=\"$color[0]\" WIDTH=100%>";
91 echo " <TABLE WIDTH=100% CELLSPACING=0 BORDER=0 COLS=2 CELLPADDING=3>";
93 echo " <TD ALIGN=LEFT WIDTH=50%>";
94 echo " <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
95 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
96 echo _("Message List");
97 echo "</A> | ";
98 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">";
100 echo "</A> ";
102 echo " </TD><TD WIDTH=50% ALIGN=RIGHT>";
103 echo " <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
104 echo " <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">";
106 echo "</A> | ";
107 echo " <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
109 echo "</A> | ";
110 echo " <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
112 echo "</A> ";
118 echo " <TR><TD CELLSPACING=0 WIDTH=100%>";
119 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=3>\n";
122 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
123 echo " <FONT FACE=\"Arial,Helvetica\">";
126 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
127 echo " <FONT FACE=\"Arial,Helvetica\"><B>$subject</B></FONT>\n";
132 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
133 echo " <FONT FACE=\"Arial,Helvetica\">";
136 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
137 echo " <FONT FACE=\"Arial,Helvetica\"><B>$from_name</B></FONT>\n";
142 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
143 echo " <FONT FACE=\"Arial,Helvetica\">";
146 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
147 echo " <FONT FACE=\"Arial,Helvetica\"><B>$dateString</B></FONT>\n";
152 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
153 echo " <FONT FACE=\"Arial,Helvetica\">";
156 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
157 echo " <FONT FACE=\"Arial,Helvetica\"><B>$to_string</B></FONT>\n";
161 if ($message["HEADER"]["CC"][0]) {
163 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
164 echo " <FONT FACE=\"Arial,Helvetica\">Cc:</FONT>\n";
165 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
166 echo " <FONT FACE=\"Arial,Helvetica\"><B>$cc_string</B></FONT>\n";
173 echo " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
174 $body = formatBody($message, $color, $wrap_at);
179 echo " </TD></TR>\n";
180 echo " <TR><TD BGCOLOR=\"$color[9]\"> </TD></TR>";