84f7855795539aaddd803351fba7eb3a17406a26
[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 " <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
30 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">Message List</A>&nbsp;&nbsp;";
31 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">Delete</A>&nbsp;&nbsp;";
32 echo " </FONT>";
33 echo " </TD></TR>";
34 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%>";
35 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2>\n";
36 echo " <TR>\n";
37 /** subject **/
38 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
39 echo " <FONT FACE=\"Arial,Helvetica\">Subject:</FONT>\n";
40 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
41 echo " <FONT FACE=\"Arial,Helvetica\"><B>$subject</B></FONT>\n";
42 echo " </TD>\n";
43 echo " </TR>\n";
44 /** from **/
45 echo " <TR>\n";
46 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
47 echo " <FONT FACE=\"Arial,Helvetica\">From:</FONT>\n";
48 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
49 echo " <FONT FACE=\"Arial,Helvetica\"><B>$from_name</B></FONT>\n";
50 echo " </TD>\n";
51 echo " </TR>\n";
52 /** date **/
53 echo " <TR>\n";
54 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
55 echo " <FONT FACE=\"Arial,Helvetica\">Date:</FONT>\n";
56 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
57 echo " <FONT FACE=\"Arial,Helvetica\"><B>$date</B></FONT>\n";
58 echo " </TD>\n";
59 echo " </TR>\n";
60
61 echo " </TABLE></TD></TR>\n";
62
63 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%><BR>\n";
64 $i = 0;
65 while ($i < count($body)) {
66 echo "$body[$i]";
67 $i++;
68 }
69 echo " <BR></TD></TR>\n";
70 echo " <TR><TD BGCOLOR=DCDCDC>&nbsp;</TD></TR>";
71 echo "</TABLE>\n";
72
73 ?>