Changeset 5700 for trunk/wp-includes/class-phpmailer.php
- Timestamp:
- 06/14/2007 02:25:30 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class-phpmailer.php (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-phpmailer.php
r5682 r5700 114 114 */ 115 115 var $Sendmail = "/usr/sbin/sendmail"; 116 116 117 117 /** 118 118 * Path to PHPMailer plugins. This is now only useful if the SMTP class … … 223 223 var $LE = "\n"; 224 224 /**#@-*/ 225 225 226 226 ///////////////////////////////////////////////// 227 227 // VARIABLE METHODS … … 383 383 return $result; 384 384 } 385 385 386 386 /** 387 387 * Sends mail using the $Sendmail program. … … 403 403 fputs($mail, $header); 404 404 fputs($mail, $body); 405 405 406 406 $result = pclose($mail) >> 8 & 0xFF; 407 407 if($result != 0) … … 549 549 else 550 550 $this->smtp->Hello($this->ServerHostname()); 551 551 552 552 if($this->SMTPAuth) 553 553 { … … 605 605 } 606 606 $this->language = $PHPMAILER_LANG; 607 607 608 608 return true; 609 609 } … … 630 630 return $addr_str; 631 631 } 632 632 633 633 /** 634 634 * Formats an address correctly. … … 727 727 return $message; 728 728 } 729 729 730 730 /** 731 731 * Set the body wrapping. … … 736 736 if($this->WordWrap < 1) 737 737 return; 738 738 739 739 switch($this->message_type) 740 740 { … … 757 757 function CreateHeader() { 758 758 $result = ""; 759 759 760 760 // Set the boundaries 761 761 $uniq_id = md5(uniqid(time())); … … 768 768 else 769 769 $result .= $this->HeaderLine("Return-Path", trim($this->Sender)); 770 770 771 771 // To be created automatically by mail() 772 772 if($this->Mailer != "mail") … … 798 798 $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); 799 799 $result .= $this->HeaderLine("X-Priority", $this->Priority); 800 800 801 801 if($this->ConfirmReadingTo != "") 802 802 { … … 866 866 $result .= $this->GetBoundary($this->boundary[1], "", 867 867 "text/html", ""); 868 868 869 869 $result .= $this->EncodeString($this->Body, $this->Encoding); 870 870 $result .= $this->LE.$this->LE; 871 871 872 872 $result .= $this->EndBoundary($this->boundary[1]); 873 873 break; … … 879 879 $result .= $this->EncodeString($this->Body, $this->Encoding); 880 880 $result .= $this->LE; 881 881 882 882 $result .= $this->AttachAll(); 883 883 break; … … 888 888 "multipart/alternative", $this->LE, 889 889 $this->boundary[2], $this->LE.$this->LE); 890 890 891 891 // Create text body 892 892 $result .= $this->GetBoundary($this->boundary[2], "", … … 895 895 $result .= $this->EncodeString($this->AltBody, $this->Encoding); 896 896 $result .= $this->LE.$this->LE; 897 897 898 898 // Create the HTML body 899 899 $result .= $this->GetBoundary($this->boundary[2], "", 900 900 "text/html", "") . $this->LE; 901 901 902 902 $result .= $this->EncodeString($this->Body, $this->Encoding); 903 903 $result .= $this->LE.$this->LE; 904 904 905 905 $result .= $this->EndBoundary($this->boundary[2]); 906 906 907 907 $result .= $this->AttachAll(); 908 908 break; … … 930 930 $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); 931 931 $result .= $this->LE; 932 932 933 933 return $result; 934 934 } 935 935 936 936 /** 937 937 * Returns the end of a message boundary. … … 941 941 return $this->LE . "--" . $boundary . "--" . $this->LE; 942 942 } 943 943 944 944 /** 945 945 * Sets the message type. … … 1044 1044 $disposition = $this->attachment[$i][6]; 1045 1045 $cid = $this->attachment[$i][7]; 1046 1046 1047 1047 $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); 1048 1048 $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); … … 1074 1074 return join("", $mime); 1075 1075 } 1076 1076 1077 1077 /** 1078 1078 * Encodes attachment in requested format. Returns an … … 1136 1136 function EncodeHeader ($str, $position = 'text') { 1137 1137 $x = 0; 1138 1138 1139 1139 switch (strtolower($position)) { 1140 1140 case 'phrase': … … 1178 1178 $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); 1179 1179 $encoded = trim(str_replace("\n", $this->LE, $encoded)); 1180 1180 1181 1181 return $encoded; 1182 1182 } 1183 1183 1184 1184 /** 1185 1185 * Encode string to quoted-printable. … … 1227 1227 break; 1228 1228 } 1229 1229 1230 1230 // Replace every spaces to _ (more readable than =20) 1231 1231 $encoded = str_replace(" ", "_", $encoded); … … 1257 1257 $this->attachment[$cur][7] = 0; 1258 1258 } 1259 1259 1260 1260 /** 1261 1261 * Adds an embedded attachment. This can include images, sounds, and … … 1273 1273 function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", 1274 1274 $type = "application/octet-stream") { 1275 1275 1276 1276 if(!@is_file($path)) 1277 1277 { … … 1294 1294 $this->attachment[$cur][6] = "inline"; 1295 1295 $this->attachment[$cur][7] = $cid; 1296 1296 1297 1297 return true; 1298 1298 } 1299 1299 1300 1300 /** 1301 1301 * Returns true if an inline attachment is present. … … 1313 1313 } 1314 1314 } 1315 1315 1316 1316 return $result; 1317 1317 } … … 1411 1411 return $result; 1412 1412 } 1413 1413 1414 1414 /** 1415 1415 * Returns the appropriate server variable. Should work with both … … 1429 1429 $_SERVER = $HTTP_ENV_VARS; // must be Apache 1430 1430 } 1431 1431 1432 1432 if(isset($_SERVER[$varName])) 1433 1433 return $_SERVER[$varName]; … … 1460 1460 if(count($this->language) < 1) 1461 1461 $this->SetLanguage("en"); // set the default language 1462 1462 1463 1463 if(isset($this->language[$key])) 1464 1464 return $this->language[$key]; … … 1466 1466 return "Language string failed to load: " . $key; 1467 1467 } 1468 1468 1469 1469 /** 1470 1470 * Returns true if an error occurred.
Note: See TracChangeset
for help on using the changeset viewer.