added To: field
[squirrelmail.git] / src / compose.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 echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">\n";
10 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
11 displayPageHeader("None");
12
13 if ($reply_id) {
14 selectMailbox($imapConnection, $mailbox, $numMessages);
15 $body_ary = fetchBody($imapConnection, $reply_id);
16 for ($i=0;$i < count($body_ary);$i++) {
17 $tmp = strip_tags($body_ary[$i]);
18 $tmp = substr($tmp, 0, strlen($tmp) -1);
19 $body = "$body> $tmp";
20 }
21 } else if ($forward_id) {
22 selectMailbox($imapConnection, $mailbox, $numMessages);
23 $body_ary = fetchBody($imapConnection, $forward_id);
24 for ($i=0;$i < count($body_ary);$i++) {
25 $tmp = strip_tags($body_ary[$i]);
26 $tmp = substr($tmp, 0, strlen($tmp) -1);
27 $body = "$body> $tmp";
28 }
29 }
30
31 echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
32 echo "<CENTER>";
33 echo "<TABLE COLS=2 WIDTH=100% ALIGN=CENTER>\n";
34 echo " <TR>\n";
35 echo " <TD WIDTH=15% BGCOLOR=FFFFFF ALIGN=RIGHT>\n";
36 echo " <FONT FACE=\"Arial,Helvetica\">To: </FONT>\n";
37 echo " </TD><TD WIDTH=85% BGCOLOR=FFFFFF ALIGN=LEFT>\n";
38 if ($send_to)
39 echo " <INPUT TYPE=TEXT NAME=passed_to VALUE=\"$send_to\" SIZE=60><BR>";
40 else
41 echo " <INPUT TYPE=TEXT NAME=passed_to SIZE=60><BR>";
42 echo " </TD>\n";
43 echo " </TR>\n";
44 echo " <TR>\n";
45 echo " <TD WIDTH=15% BGCOLOR=FFFFFF ALIGN=RIGHT>\n";
46 echo " <FONT FACE=\"Arial,Helvetica\">CC:</FONT>\n";
47 echo " </TD><TD WIDTH=85% BGCOLOR=FFFFFF ALIGN=LEFT>\n";
48 echo " <INPUT TYPE=TEXT NAME=passed_cc SIZE=60><BR>";
49 echo " </TD>\n";
50 echo " </TR>\n";
51 echo " <TR>\n";
52 echo " <TD WIDTH=15% BGCOLOR=FFFFFF ALIGN=RIGHT>\n";
53 echo " <FONT FACE=\"Arial,Helvetica\">BCC:</FONT>\n";
54 echo " </TD><TD WIDTH=85% BGCOLOR=FFFFFF ALIGN=LEFT>\n";
55 echo " <INPUT TYPE=TEXT NAME=passed_bcc SIZE=60><BR>";
56 echo " </TD>\n";
57 echo " </TR>\n";
58 echo " <TR>\n";
59 echo " <TD WIDTH=15% BGCOLOR=FFFFFF ALIGN=RIGHT>\n";
60 echo " <FONT FACE=\"Arial,Helvetica\">Subject:</FONT>\n";
61 echo " </TD><TD WIDTH=85% BGCOLOR=FFFFFF ALIGN=LEFT>\n";
62 if ($reply_subj)
63 echo " <INPUT TYPE=TEXT NAME=passed_subject SIZE=60 VALUE=\"Re: $reply_subj\"><BR>";
64 else if ($forward_subj)
65 echo " <INPUT TYPE=TEXT NAME=passed_subject SIZE=60 VALUE=\"[Fwd: $forward_subj]\"><BR>";
66 else
67 echo " <INPUT TYPE=TEXT NAME=passed_subject SIZE=60><BR>";
68 echo " </TD>\n";
69 echo " </TR>\n";
70 echo "</TABLE>\n";
71
72 echo "<TEXTAREA NAME=passed_body ROWS=20 COLS=76 WRAP=HARD>$body</TEXTAREA><BR>";
73 echo "<INPUT TYPE=SUBMIT VALUE=\"Send\">";
74 echo "</CENTER>";
75 echo "</FORM>";
76 ?>