added patch to allow use of sendmail instead of connecting to SMTP port
[squirrelmail.git] / src / compose_send.php
CommitLineData
40ee9452 1<HTML>
b8ea4ed6 2<?
3 include("../config/config.php");
4 include("../functions/strings.php");
5 include("../functions/page_header.php");
6 include("../functions/mailbox.php");
7 include("../functions/smtp.php");
a0c694f0 8 include("../functions/display_messages.php");
9
d3cdb279 10 include("../src/load_prefs.php");
11
e2370222 12 if ($passed_body == "") {
f8f9bed9 13 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
14 displayPageHeader($color, "None");
15 plain_error_message("You have not entered a message body.", $color);
e2370222 16 exit;
17 } else if ($passed_to == "") {
f8f9bed9 18 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
19 displayPageHeader($color, "None");
20 plain_error_message("You have not filled in the \"To:\" field.", $color);
a0c694f0 21 echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
22
23 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_subject\" NAME=passed_subject><BR>";
24 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_cc\" NAME=passed_cc><BR>";
25 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_bcc\" NAME=passed_bcc><BR>";
26 echo "<CENTER><FONT FACE=\"Arial,Helvetica\">To: </FONT><INPUT TYPE=TEXT NAME=passed_to SIZE=60><BR>";
27 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_body\" NAME=passed_body><BR>";
28 echo "<INPUT TYPE=SUBMIT VALUE=\"Send\">";
29 echo "</CENTER></FORM>\n";
30
31 exit;
a0c694f0 32 } else if ($passed_subject == "") {
f8f9bed9 33 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
34 displayPageHeader($color, "None");
35 plain_error_message("You have not entered a subject.", $color);
a0c694f0 36 echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
ff89ac8a 37 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_to\" NAME=passed_to><BR>";
a0c694f0 38 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_cc\" NAME=passed_cc><BR>";
39 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_bcc\" NAME=passed_bcc><BR>";
40 echo "<CENTER><FONT FACE=\"Arial,Helvetica\">Subject: </FONT><INPUT TYPE=TEXT NAME=passed_subject SIZE=60 VALUE=\"(no subject)\"><BR>";
41 echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_body\" NAME=passed_body><BR>";
42 echo "<INPUT TYPE=SUBMIT VALUE=\"Send\">";
43 echo "</CENTER></FORM>\n";
44
45 exit;
46 }
b8ea4ed6 47
102cbc7b 48 $passed_body = stripslashes($passed_body);
4b3dfbbb 49 $passed_body = stripslashes($passed_body); // Apparently I have to remove them twice.. dunno why.
102cbc7b 50 $passed_to = stripslashes($passed_to);
51 $passed_cc = stripslashes($passed_cc);
52 $passed_bcc = stripslashes($passed_bcc);
53 $passed_subject = stripslashes($passed_subject);
54
465db5d7 55 sendMessage($username, $domain, $passed_to, $passed_cc, $passed_bcc, $passed_subject, $passed_body, $version);
40ee9452 56
78509c54 57 if ($auto_forward == true)
7ce342dc 58 echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=right_main.php\">";
f8f9bed9 59 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
a0c694f0 60
f8f9bed9 61 displayPageHeader($color, "None");
40ee9452 62 echo "<FONT FACE=\"Arial,Helvetica\">";
63 echo "<BR><BR><BR><CENTER><B>Message Sent!</B><BR><BR>";
64 echo "You will be automatically forwarded.<BR>If not, <A HREF=\"right_main.php\">click here</A>";
65 echo "</CENTER></FONT>";
66?>
465db5d7 67</BODY></HTML>