Browse Source

* Fixed text attachment handling (adds \r\n because we don't know
if the text file has one at the end or not)
* Fixed the user -> <user>@domain (now adds domain before adding <> around
address)

Tyler Akins 24 years ago
parent
commit
ec3cca2292
1 changed files with 6 additions and 4 deletions
  1. 6 4
      functions/smtp.php

+ 6 - 4
functions/smtp.php

@@ -59,12 +59,10 @@
          }
 	 else
 	 {
+	    if (strpos($array[$i], '@') === false)
+	       $array[$i] .= '@' . $domain;
 	    $array[$i] = '<' . $array[$i] . '>';
 	 }
-	 
-	 if (strpos($array[$i], '@') === false) {
-	    $array[$i] .= '@' . $domain;
-	 }
       }
       return $array;
    }
@@ -78,6 +76,9 @@
       if (isMultipart()) {
          foreach ($attachments as $info)
 	 {
+//	    echo "<pre>Attachment Info:\n";
+//	    var_dump($info);
+//	    echo "\n</pre>\n";
 	    if (isset($info['type']))
  	       $filetype = $info['type'];
             else
@@ -99,6 +100,7 @@
 	          $tmp = str_replace("\r\n", "\n", $tmp);
 	          $tmp = str_replace("\r", "\n", $tmp);
 	          $tmp = str_replace("\n", "\r\n", $tmp);
+		  $tmp .= "\r\n";
 		  fputs($fp, $tmp);
 		  $length += strlen($tmp);
 	       }