Fixes some bugs in preferences
[squirrelmail.git] / functions / smtp.php
index a5b7934a02fca2bfeef32346edf536c2c268c635..0bfaf93506fe66af7a0fc54382749b8c6b297904 100644 (file)
@@ -24,8 +24,9 @@
       $bcc = parseAddrs($b);
       $body = stripslashes($body);
       $from_addr = "$username@$domain";
-      $reply_to = getPref($username, "reply_to");
-      $from = getPref($username, "full_name");
+      $reply_to = getPref($data_dir, $username, "reply_to");
+      $from = getPref($data_dir, $username, "full_name");
+
       if ($from == "")
          $from = "<$from_addr>";
       else
          fputs($smtpConnection, "Cc: <$cc_list>\n"); // Who the CCs are
       }
       fputs($smtpConnection, "X-Mailer: SquirrelMail (version $version)\n"); // Identify SquirrelMail
-      fputs($smtpConnection, "Reply-To: $reply_to\n");
       fputs($smtpConnection, "MIME-Version: 1.0\n");
       fputs($smtpConnection, "Content-Type: text/plain\n");
+      if ($reply_to != "")
+         fputs($smtpConnection, "Reply-To: $reply_to\n");
 
       fputs($smtpConnection, "$body\n"); // send the body of the message