Beautified top of message list a bit
[squirrelmail.git] / src / read_body.php
1 <?
2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
6 include("../functions/mailbox.php");
7 include("../functions/date.php");
8
9 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
10 selectMailbox($imapConnection, $mailbox, $numMessages);
11
12 echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">\n";
13 displayPageHeader($mailbox);
14 $body = fetchBody($imapConnection, $passed_id);
15 getMessageHeaders($imapConnection, $passed_id, $passed_id, $f, $s, $d);
16 // setMessageFlag($imapConnection, $passed_id, $passed_id, "Seen");
17
18 $subject = $s[0];
19 $d[0] = ereg_replace(" ", " ", $d[0]);
20 // $date = explode(" ", trim($d[0]));
21 // $date = getDateString($date);
22 $date = $d[0];
23 $from_name = getSenderName($f[0]);
24 $urlMailbox = urlencode($mailbox);
25
26 echo "<BR>";
27 echo "<TABLE COLS=1 WIDTH=95% BORDER=0 ALIGN=CENTER CELLPADDING=2>\n";
28 echo " <TR><TD BGCOLOR=DCDCDC WIDTH=100%>";
29 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">Message List</A>&nbsp;&nbsp;";
30 echo " </TD></TR>";
31 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%>";
32 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2>\n";
33 echo " <TR>\n";
34 /** subject **/
35 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
36 echo " <FONT FACE=\"Arial,Helvetica\">Subject:</FONT>\n";
37 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
38 echo " <FONT FACE=\"Arial,Helvetica\"><B>$subject</B></FONT>\n";
39 echo " </TD>\n";
40 echo " </TR>\n";
41 /** from **/
42 echo " <TR>\n";
43 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
44 echo " <FONT FACE=\"Arial,Helvetica\">From:</FONT>\n";
45 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
46 echo " <FONT FACE=\"Arial,Helvetica\"><B>$from_name</B></FONT>\n";
47 echo " </TD>\n";
48 echo " </TR>\n";
49 /** date **/
50 echo " <TR>\n";
51 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
52 echo " <FONT FACE=\"Arial,Helvetica\">Date:</FONT>\n";
53 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
54 echo " <FONT FACE=\"Arial,Helvetica\"><B>$date</B></FONT>\n";
55 echo " </TD>\n";
56 echo " </TR>\n";
57
58 echo " </TABLE></TD></TR>\n";
59
60 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%><BR>\n";
61 $i = 0;
62 while ($i < count($body)) {
63 echo "$body[$i]";
64 $i++;
65 }
66 echo " <BR></TD></TR>\n";
67 echo " <TR><TD BGCOLOR=DCDCDC>&nbsp;</TD></TR>";
68 echo "</TABLE>\n";
69
70 ?>