updated some sending stuff
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 4 Dec 1999 20:05:29 +0000 (20:05 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 4 Dec 1999 20:05:29 +0000 (20:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@58 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/config.php
functions/smtp.php
src/compose_send.php

index a4a5cde4511576ad5d01b0fcb6074aecd34eeee8..dfbb4e3d8b49f5124744ef6fe185a241a68326bf 100644 (file)
@@ -9,6 +9,14 @@ $org_name = "Operation Mobilization";
 $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;
 
index bf83ab711da9b62b524b268e1d43fffa4507f2fb..bae3ccb89fb06de08dd4e2fa33bd5ec042ae9b97 100644 (file)
       }
    }
 
-   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>";
@@ -26,7 +30,7 @@
       }
       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");
@@ -36,6 +40,9 @@
       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>";
index c9043a38443ef6d5d8523faf432fcea5f9571fbe..aba3ccf7e79cb73e247a77863d81ba83dd9aeeb7 100644 (file)
@@ -5,6 +5,6 @@
    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