$imapServerAddress = "adam.usa.om.org";
$imapPort = 143;
+/* The domain where your email address is.
+ * EX: in "luke@usa.om.org", usa.om.org is the domain.
+ * this is for all the messages sent out. Reply address
+ * is generated by $username@$domain
+ */
+$domain = "usa.om.org";
+
+/* Your SMTP server and port number (usually the same as the IMAP server) */
$smtpServerAddress = "adam.usa.om.org";
$smtpPort = 25;
}
}
- function sendMessage($to, $subject, $body) {
+ function sendMessage($smtpServerAddress, $smtpPort, $to, $subject, $body) {
+ $to = addslashes($to);
+ $body = addslashes($body);
+ $from = "$username@$domain";
+
echo "<FONT FACE=\"Arial,Helvetica\">";
- $smtpConnection = fsockopen("10.4.1.1", 25, $errorNumber, $errorString);
+ $smtpConnection = fsockopen($smtpServerAddress, $smtpPort, $errorNumber, $errorString);
if (!$smtpConnection) {
echo "Error connecting to SMTP Server.<br>";
echo "$errorNumber : $errorString<br>";
}
echo htmlspecialchars(fgets($smtpConnection, 1024)) . "<BR>";
- fputs($smtpConnection, "MAIL FROM:<luke@usa.om.org>\n");
+ fputs($smtpConnection, "MAIL FROM:<$from>\n");
echo htmlspecialchars(fgets($smtpConnection, 1024)) . "<BR>";
fputs($smtpConnection, "RCPT TO:<$to>\n");
echo htmlspecialchars(fgets($smtpConnection, 1024)) . "<BR>";
fputs($smtpConnection, "Subject: $subject\n");
+ fputs($smtpConnection, "Date: " . date() . "\n");
+ fputs($smtpConnection, "To: <$to>\n");
+ fputs($smtpConnection, "From: <$from>\n");
fputs($smtpConnection, "$body\n");
fputs($smtpConnection, ".\n");
echo htmlspecialchars(fgets($smtpConnection, 1024)) . "<BR>";
include("../functions/mailbox.php");
include("../functions/smtp.php");
- sendMessage($passed_to, $passed_subject, $passed_body);
+ sendMessage($smtpServerAddress, $smtpPort, $passed_to, $passed_subject, $passed_body);
echo "<A HREF=\"right_main.php\">RETURN</A>";
?>
\ No newline at end of file