Got reply and forward working
[squirrelmail.git] / src / read_body.php
CommitLineData
be69e508 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
17 $subject = $s[0];
31f3d7c0 18 $url_subj = urlencode(trim($subject));
19
be69e508 20 $d[0] = ereg_replace(" ", " ", $d[0]);
be69e508 21 $date = $d[0];
22 $from_name = getSenderName($f[0]);
8467bf00 23 $urlMailbox = urlencode($mailbox);
be69e508 24
31f3d7c0 25 $url_from = trim(decodeEmailAddr($f[0]));
26 $url_from = urlencode($url_from);
27
8467bf00 28 echo "<BR>";
29 echo "<TABLE COLS=1 WIDTH=95% BORDER=0 ALIGN=CENTER CELLPADDING=2>\n";
30 echo " <TR><TD BGCOLOR=DCDCDC WIDTH=100%>";
31f3d7c0 31 echo " <TABLE WIDTH=100% BORDER=0 COLS=2>";
32 echo " <TR>";
33 echo " <TD ALIGN=LEFT WIDTH=50%>";
34 echo " <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
35 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">Message List</A>&nbsp;&nbsp;";
36 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">Delete</A>&nbsp;&nbsp;";
37 echo " </FONT>";
38 echo " </TD><TD WIDTH=50% ALIGN=RIGHT>";
39 echo " <FONT FACE=\"Arial,Helvetica\" SIZE=2>";
40 echo " <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">Forward</A>&nbsp;&nbsp;";
41 echo " <A HREF=\"compose.php?send_to=$url_from&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">Reply</A>&nbsp;&nbsp;";
42 echo " </FONT>";
43 echo " </TD>";
44 echo " </TR>";
45 echo " </TABLE>";
8467bf00 46 echo " </TD></TR>";
47 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%>";
be69e508 48 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2>\n";
49 echo " <TR>\n";
50 /** subject **/
51 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
52 echo " <FONT FACE=\"Arial,Helvetica\">Subject:</FONT>\n";
53 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
54 echo " <FONT FACE=\"Arial,Helvetica\"><B>$subject</B></FONT>\n";
55 echo " </TD>\n";
56 echo " </TR>\n";
57 /** from **/
58 echo " <TR>\n";
59 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
60 echo " <FONT FACE=\"Arial,Helvetica\">From:</FONT>\n";
61 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
62 echo " <FONT FACE=\"Arial,Helvetica\"><B>$from_name</B></FONT>\n";
63 echo " </TD>\n";
64 echo " </TR>\n";
65 /** date **/
66 echo " <TR>\n";
67 echo " <TD BGCOLOR=FFFFFF WIDTH=15% ALIGN=RIGHT>\n";
68 echo " <FONT FACE=\"Arial,Helvetica\">Date:</FONT>\n";
69 echo " </TD><TD BGCOLOR=FFFFFF WIDTH=85%>\n";
70 echo " <FONT FACE=\"Arial,Helvetica\"><B>$date</B></FONT>\n";
71 echo " </TD>\n";
72 echo " </TR>\n";
73
74 echo " </TABLE></TD></TR>\n";
75
8467bf00 76 echo " <TR><TD BGCOLOR=FFFFFF WIDTH=100%><BR>\n";
e550d551 77 $i = 0;
78 while ($i < count($body)) {
79 echo "$body[$i]";
be69e508 80 $i++;
81 }
e550d551 82 echo " <BR></TD></TR>\n";
be69e508 83 echo " <TR><TD BGCOLOR=DCDCDC>&nbsp;</TD></TR>";
84 echo "</TABLE>\n";
85
86?>