Changeset 6026 for trunk/wp-includes/class-phpmailer.php
- Timestamp:
- 09/03/2007 11:32:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-phpmailer.php
r5852 r6026 97 97 98 98 /** 99 * Sets word wrapping on the body of the message to a given number of 99 * Sets word wrapping on the body of the message to a given number of 100 100 * characters. 101 101 * @var int … … 116 116 117 117 /** 118 * Path to PHPMailer plugins. This is now only useful if the SMTP class 119 * is in a different directory than the PHP include path. 118 * Path to PHPMailer plugins. This is now only useful if the SMTP class 119 * is in a different directory than the PHP include path. 120 120 * @var string 121 121 */ … … 187 187 188 188 /** 189 * Sets the SMTP server timeout in seconds. This function will not 189 * Sets the SMTP server timeout in seconds. This function will not 190 190 * work with the win32 version. 191 191 * @var int … … 200 200 201 201 /** 202 * Prevents the SMTP connection from being closed after each mail 203 * sending. If this is set to true then to close the connection 204 * requires an explicit call to SmtpClose(). 202 * Prevents the SMTP connection from being closed after each mail 203 * sending. If this is set to true then to close the connection 204 * requires an explicit call to SmtpClose(). 205 205 * @var bool 206 206 */ … … 229 229 230 230 /** 231 * Sets message type to HTML. 231 * Sets message type to HTML. 232 232 * @param bool $bool 233 233 * @return void … … 265 265 266 266 /** 267 * Sets Mailer to send message using the qmail MTA. 267 * Sets Mailer to send message using the qmail MTA. 268 268 * @return void 269 269 */ … … 279 279 280 280 /** 281 * Adds a "To" address. 281 * Adds a "To" address. 282 282 * @param string $address 283 283 * @param string $name … … 293 293 * Adds a "Cc" address. Note: this function works 294 294 * with the SMTP mailer on win32, not with the "mail" 295 * mailer. 295 * mailer. 296 296 * @param string $address 297 297 * @param string $name … … 307 307 * Adds a "Bcc" address. Note: this function works 308 308 * with the SMTP mailer on win32, not with the "mail" 309 * mailer. 309 * mailer. 310 310 * @param string $address 311 311 * @param string $name … … 319 319 320 320 /** 321 * Adds a "Reply-to" address. 321 * Adds a "Reply-to" address. 322 322 * @param string $address 323 323 * @param string $name … … 338 338 * Creates message and assigns Mailer. If the message is 339 339 * not sent successfully then it returns false. Use the ErrorInfo 340 * variable to view description of the error. 340 * variable to view description of the error. 341 341 * @return bool 342 342 */ … … 385 385 386 386 /** 387 * Sends mail using the $Sendmail program. 387 * Sends mail using the $Sendmail program. 388 388 * @access private 389 389 * @return bool … … 415 415 416 416 /** 417 * Sends mail using the PHP mail() function. 417 * Sends mail using the PHP mail() function. 418 418 * @access private 419 419 * @return bool … … 432 432 ini_set("sendmail_from", $this->Sender); 433 433 $params = sprintf("-oi -f %s", $this->Sender); 434 $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, 434 $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, 435 435 $header, $params); 436 436 } … … 519 519 520 520 /** 521 * Initiates a connection to an SMTP server. Returns false if the 521 * Initiates a connection to an SMTP server. Returns false if the 522 522 * operation failed. 523 523 * @access private … … 530 530 $hosts = explode(";", $this->Host); 531 531 $index = 0; 532 $connection = ($this->smtp->Connected()); 532 $connection = ($this->smtp->Connected()); 533 533 534 534 // Retry while there is no connection … … 552 552 if($this->SMTPAuth) 553 553 { 554 if(!$this->smtp->Authenticate($this->Username, 554 if(!$this->smtp->Authenticate($this->Username, 555 555 $this->Password)) 556 556 { … … 586 586 587 587 /** 588 * Sets the language for all class error messages. Returns false 588 * Sets the language for all class error messages. Returns false 589 589 * if it cannot load the language file. The default language type 590 590 * is English. … … 614 614 615 615 /** 616 * Creates recipient headers. 616 * Creates recipient headers. 617 617 * @access private 618 618 * @return string … … 632 632 633 633 /** 634 * Formats an address correctly. 634 * Formats an address correctly. 635 635 * @access private 636 636 * @return string … … 641 641 else 642 642 { 643 $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . 643 $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . 644 644 $addr[0] . ">"; 645 645 } … … 651 651 * Wraps message for use with mailers that do not 652 652 * automatically perform wrapping and for quoted-printable. 653 * Original written by philippe. 653 * Original written by philippe. 654 654 * @access private 655 655 * @return string … … 713 713 { 714 714 $buf_o = $buf; 715 $buf .= ($e == 0) ? $word : (" " . $word); 715 $buf .= ($e == 0) ? $word : (" " . $word); 716 716 717 717 if (strlen($buf) > $length and $buf_o != "") … … 751 751 752 752 /** 753 * Assembles message header. 753 * Assembles message header. 754 754 * @access private 755 755 * @return string … … 783 783 $from[0][0] = trim($this->From); 784 784 $from[0][1] = $this->FromName; 785 $result .= $this->AddrAppend("From", $from); 785 $result .= $this->AddrAppend("From", $from); 786 786 787 787 // sendmail and mail() extract Bcc from the header before sending … … 801 801 if($this->ConfirmReadingTo != "") 802 802 { 803 $result .= $this->HeaderLine("Disposition-Notification-To", 803 $result .= $this->HeaderLine("Disposition-Notification-To", 804 804 "<" . trim($this->ConfirmReadingTo) . ">"); 805 805 } … … 808 808 for($index = 0; $index < count($this->CustomHeader); $index++) 809 809 { 810 $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 810 $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 811 811 $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); 812 812 } … … 825 825 if($this->InlineImageExists()) 826 826 { 827 $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 828 "multipart/related", $this->LE, $this->LE, 827 $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 828 "multipart/related", $this->LE, $this->LE, 829 829 $this->boundary[1], $this->LE); 830 830 } … … 860 860 { 861 861 case "alt": 862 $result .= $this->GetBoundary($this->boundary[1], "", 862 $result .= $this->GetBoundary($this->boundary[1], "", 863 863 "text/plain", ""); 864 864 $result .= $this->EncodeString($this->AltBody, $this->Encoding); 865 865 $result .= $this->LE.$this->LE; 866 $result .= $this->GetBoundary($this->boundary[1], "", 866 $result .= $this->GetBoundary($this->boundary[1], "", 867 867 "text/html", ""); 868 868 … … 886 886 $result .= sprintf("Content-Type: %s;%s" . 887 887 "\tboundary=\"%s\"%s", 888 "multipart/alternative", $this->LE, 888 "multipart/alternative", $this->LE, 889 889 $this->boundary[2], $this->LE.$this->LE); 890 890 891 891 // Create text body 892 $result .= $this->GetBoundary($this->boundary[2], "", 892 $result .= $this->GetBoundary($this->boundary[2], "", 893 893 "text/plain", "") . $this->LE; 894 894 … … 897 897 898 898 // Create the HTML body 899 $result .= $this->GetBoundary($this->boundary[2], "", 899 $result .= $this->GetBoundary($this->boundary[2], "", 900 900 "text/html", "") . $this->LE; 901 901 … … 925 925 926 926 $result .= $this->TextLine("--" . $boundary); 927 $result .= sprintf("Content-Type: %s; charset = \"%s\"", 927 $result .= sprintf("Content-Type: %s; charset = \"%s\"", 928 928 $contentType, $charSet); 929 929 $result .= $this->LE; … … 939 939 */ 940 940 function EndBoundary($boundary) { 941 return $this->LE . "--" . $boundary . "--" . $this->LE; 941 return $this->LE . "--" . $boundary . "--" . $this->LE; 942 942 } 943 943 … … 993 993 * @return bool 994 994 */ 995 function AddAttachment($path, $name = "", $encoding = "base64", 995 function AddAttachment($path, $name = "", $encoding = "base64", 996 996 $type = "application/octet-stream") { 997 997 if(!@is_file($path)) … … 1052 1052 $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); 1053 1053 1054 $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", 1054 $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", 1055 1055 $disposition, $name, $this->LE.$this->LE); 1056 1056 … … 1064 1064 else 1065 1065 { 1066 $mime[] = $this->EncodeFile($path, $encoding); 1066 $mime[] = $this->EncodeFile($path, $encoding); 1067 1067 if($this->IsError()) { return ""; } 1068 1068 $mime[] = $this->LE.$this->LE; … … 1130 1130 1131 1131 /** 1132 * Encode a header string to best of Q, B, quoted or none. 1132 * Encode a header string to best of Q, B, quoted or none. 1133 1133 * @access private 1134 1134 * @return string … … 1183 1183 1184 1184 /** 1185 * Encode string to quoted-printable. 1185 * Encode string to quoted-printable. 1186 1186 * @access private 1187 1187 * @return string … … 1206 1206 1207 1207 /** 1208 * Encode string to q encoding. 1208 * Encode string to q encoding. 1209 1209 * @access private 1210 1210 * @return string … … 1244 1244 * @return void 1245 1245 */ 1246 function AddStringAttachment($string, $filename, $encoding = "base64", 1246 function AddStringAttachment($string, $filename, $encoding = "base64", 1247 1247 $type = "application/octet-stream") { 1248 1248 // Append to $attachment array … … 1259 1259 1260 1260 /** 1261 * Adds an embedded attachment. This can include images, sounds, and 1262 * just about any other document. Make sure to set the $type to an 1263 * image type. For JPEG images use "image/jpeg" and for GIF images 1261 * Adds an embedded attachment. This can include images, sounds, and 1262 * just about any other document. Make sure to set the $type to an 1263 * image type. For JPEG images use "image/jpeg" and for GIF images 1264 1264 * use "image/gif". 1265 1265 * @param string $path Path to the attachment. 1266 * @param string $cid Content ID of the attachment. Use this to identify 1266 * @param string $cid Content ID of the attachment. Use this to identify 1267 1267 * the Id for accessing the image in an HTML form. 1268 1268 * @param string $name Overrides the attachment name. 1269 1269 * @param string $encoding File encoding (see $Encoding). 1270 * @param string $type File extension (MIME) type. 1270 * @param string $type File extension (MIME) type. 1271 1271 * @return bool 1272 1272 */ 1273 function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", 1273 function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", 1274 1274 $type = "application/octet-stream") { 1275 1275 … … 1398 1398 1399 1399 /** 1400 * Returns the proper RFC 822 formatted date. 1400 * Returns the proper RFC 822 formatted date. 1401 1401 * @access private 1402 1402 * @return string … … 1413 1413 1414 1414 /** 1415 * Returns the appropriate server variable. Should work with both 1416 * PHP 4.1.0+ as well as older versions. Returns an empty string 1415 * Returns the appropriate server variable. Should work with both 1416 * PHP 4.1.0+ as well as older versions. Returns an empty string 1417 1417 * if nothing is found. 1418 1418 * @access private … … 1476 1476 1477 1477 /** 1478 * Changes every end of line from CR or LF to CRLF. 1478 * Changes every end of line from CR or LF to CRLF. 1479 1479 * @access private 1480 1480 * @return string … … 1488 1488 1489 1489 /** 1490 * Adds a custom header. 1490 * Adds a custom header. 1491 1491 * @return void 1492 1492 */
Note: See TracChangeset
for help on using the changeset viewer.