Öffentliche Methoden | |
| __construct ($exceptions=false) | |
| IsHTML ($ishtml=true) | |
| IsSMTP () | |
| IsMail () | |
| IsSendmail () | |
| IsQmail () | |
| AddAddress ($address, $name= '') | |
| AddCC ($address, $name= '') | |
| AddBCC ($address, $name= '') | |
| AddReplyTo ($address, $name= '') | |
| SetFrom ($address, $name= '') | |
| Send () | |
| SmtpConnect () | |
| SmtpClose () | |
| SetLanguage ($langcode= 'en', $lang_path= 'language/') | |
| GetTranslations () | |
| AddrAppend ($type, $addr) | |
| AddrFormat ($addr) | |
| WrapText ($message, $length, $qp_mode=false) | |
| UTF8CharBoundary ($encodedText, $maxLength) | |
| SetWordWrap () | |
| CreateHeader () | |
| GetMailMIME () | |
| CreateBody () | |
| HeaderLine ($name, $value) | |
| TextLine ($value) | |
| AddAttachment ($path, $name= '', $encoding= 'base64', $type= 'application/octet-stream') | |
| GetAttachments () | |
| EncodeString ($str, $encoding= 'base64') | |
| EncodeHeader ($str, $position= 'text') | |
| HasMultiBytes ($str) | |
| Base64EncodeWrapMB ($str) | |
| EncodeQPphp ($input= '', $line_max=76, $space_conv=false) | |
| EncodeQP ($string, $line_max=76, $space_conv=false) | |
| EncodeQ ($str, $position= 'text') | |
| AddStringAttachment ($string, $filename, $encoding= 'base64', $type= 'application/octet-stream') | |
| AddEmbeddedImage ($path, $cid, $name= '', $encoding= 'base64', $type= 'application/octet-stream') | |
| InlineImageExists () | |
| ClearAddresses () | |
| ClearCCs () | |
| ClearBCCs () | |
| ClearReplyTos () | |
| ClearAllRecipients () | |
| ClearAttachments () | |
| ClearCustomHeaders () | |
| IsError () | |
| AddCustomHeader ($custom_header) | |
| MsgHTML ($message, $basedir= '') | |
| set ($name, $value= '') | |
| SecureHeader ($str) | |
| Sign ($cert_filename, $key_filename, $key_pass) | |
Öffentliche, statische Methoden | |
| static | ValidateAddress ($address) |
| static | RFCDate () |
| static | _mime_types ($ext= '') |
Öffentliche Attribute | |
| $Priority = 3 | |
| $CharSet = 'iso-8859-1' | |
| $ContentType = 'text/plain' | |
| $Encoding = '8bit' | |
| $ErrorInfo = '' | |
| $From = 'root@localhost' | |
| $FromName = 'Root User' | |
| $Sender = '' | |
| $Subject = '' | |
| $Body = '' | |
| $AltBody = '' | |
| $WordWrap = 0 | |
| $Mailer = 'mail' | |
| $Sendmail = '/usr/sbin/sendmail' | |
| $PluginDir = '' | |
| $ConfirmReadingTo = '' | |
| $Hostname = '' | |
| $MessageID = '' | |
| $Host = 'localhost' | |
| $Port = 25 | |
| $Helo = '' | |
| $SMTPSecure = '' | |
| $SMTPAuth = false | |
| $Username = '' | |
| $Password = '' | |
| $Timeout = 10 | |
| $SMTPDebug = false | |
| $SMTPKeepAlive = false | |
| $SingleTo = false | |
| $LE = "\n" | |
| $Version = '5.0.2' | |
| const | STOP_MESSAGE = 0 |
| const | STOP_CONTINUE = 1 |
| const | STOP_CRITICAL = 2 |
Geschützte Methoden | |
| SendmailSend ($header, $body) | |
| MailSend ($header, $body) | |
| SmtpSend ($header, $body) | |
| SetError ($msg) | |
Geschützte Attribute | |
| $language = array() | |
Definiert in Zeile 43 der Datei class.phpmailer.php.
| PHPMailer::__construct | ( | $ | exceptions = false |
) |
Constructor
| boolean | $exceptions Should we throw external exceptions? |
Definiert in Zeile 296 der Datei class.phpmailer.php.
| static PHPMailer::_mime_types | ( | $ | ext = '' |
) | [static] |
Gets the MIME type of the embedded or inline image
| string | File extension public |
Definiert in Zeile 1920 der Datei class.phpmailer.php.
01920 { 01921 $mimes = array( 01922 'hqx' => 'application/mac-binhex40', 01923 'cpt' => 'application/mac-compactpro', 01924 'doc' => 'application/msword', 01925 'bin' => 'application/macbinary', 01926 'dms' => 'application/octet-stream', 01927 'lha' => 'application/octet-stream', 01928 'lzh' => 'application/octet-stream', 01929 'exe' => 'application/octet-stream', 01930 'class' => 'application/octet-stream', 01931 'psd' => 'application/octet-stream', 01932 'so' => 'application/octet-stream', 01933 'sea' => 'application/octet-stream', 01934 'dll' => 'application/octet-stream', 01935 'oda' => 'application/oda', 01936 'pdf' => 'application/pdf', 01937 'ai' => 'application/postscript', 01938 'eps' => 'application/postscript', 01939 'ps' => 'application/postscript', 01940 'smi' => 'application/smil', 01941 'smil' => 'application/smil', 01942 'mif' => 'application/vnd.mif', 01943 'xls' => 'application/vnd.ms-excel', 01944 'ppt' => 'application/vnd.ms-powerpoint', 01945 'wbxml' => 'application/vnd.wap.wbxml', 01946 'wmlc' => 'application/vnd.wap.wmlc', 01947 'dcr' => 'application/x-director', 01948 'dir' => 'application/x-director', 01949 'dxr' => 'application/x-director', 01950 'dvi' => 'application/x-dvi', 01951 'gtar' => 'application/x-gtar', 01952 'php' => 'application/x-httpd-php', 01953 'php4' => 'application/x-httpd-php', 01954 'php3' => 'application/x-httpd-php', 01955 'phtml' => 'application/x-httpd-php', 01956 'phps' => 'application/x-httpd-php-source', 01957 'js' => 'application/x-javascript', 01958 'swf' => 'application/x-shockwave-flash', 01959 'sit' => 'application/x-stuffit', 01960 'tar' => 'application/x-tar', 01961 'tgz' => 'application/x-tar', 01962 'xhtml' => 'application/xhtml+xml', 01963 'xht' => 'application/xhtml+xml', 01964 'zip' => 'application/zip', 01965 'mid' => 'audio/midi', 01966 'midi' => 'audio/midi', 01967 'mpga' => 'audio/mpeg', 01968 'mp2' => 'audio/mpeg', 01969 'mp3' => 'audio/mpeg', 01970 'aif' => 'audio/x-aiff', 01971 'aiff' => 'audio/x-aiff', 01972 'aifc' => 'audio/x-aiff', 01973 'ram' => 'audio/x-pn-realaudio', 01974 'rm' => 'audio/x-pn-realaudio', 01975 'rpm' => 'audio/x-pn-realaudio-plugin', 01976 'ra' => 'audio/x-realaudio', 01977 'rv' => 'video/vnd.rn-realvideo', 01978 'wav' => 'audio/x-wav', 01979 'bmp' => 'image/bmp', 01980 'gif' => 'image/gif', 01981 'jpeg' => 'image/jpeg', 01982 'jpg' => 'image/jpeg', 01983 'jpe' => 'image/jpeg', 01984 'png' => 'image/png', 01985 'tiff' => 'image/tiff', 01986 'tif' => 'image/tiff', 01987 'css' => 'text/css', 01988 'html' => 'text/html', 01989 'htm' => 'text/html', 01990 'shtml' => 'text/html', 01991 'txt' => 'text/plain', 01992 'text' => 'text/plain', 01993 'log' => 'text/plain', 01994 'rtx' => 'text/richtext', 01995 'rtf' => 'text/rtf', 01996 'xml' => 'text/xml', 01997 'xsl' => 'text/xml', 01998 'mpeg' => 'video/mpeg', 01999 'mpg' => 'video/mpeg', 02000 'mpe' => 'video/mpeg', 02001 'qt' => 'video/quicktime', 02002 'mov' => 'video/quicktime', 02003 'avi' => 'video/x-msvideo', 02004 'movie' => 'video/x-sgi-movie', 02005 'doc' => 'application/msword', 02006 'word' => 'application/msword', 02007 'xl' => 'application/excel', 02008 'eml' => 'message/rfc822' 02009 ); 02010 return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; 02011 }

| PHPMailer::AddAddress | ( | $ | address, | |
| $ | name = '' | |||
| ) |
Adds a "To" address.
| string | $address | |
| string | $name |
Definiert in Zeile 361 der Datei class.phpmailer.php.
| PHPMailer::AddAttachment | ( | $ | path, | |
| $ | name = '', |
|||
| $ | encoding = 'base64', |
|||
| $ | type = 'application/octet-stream' | |||
| ) |
Adds an attachment from a path on the filesystem. Returns false if the file could not be found or accessed.
| string | $path Path to the attachment. | |
| string | $name Overrides the attachment name. | |
| string | $encoding File encoding (see $Encoding). | |
| string | $type File extension (MIME) type. |
Definiert in Zeile 1223 der Datei class.phpmailer.php.
01223 { 01224 try { 01225 if ( !@is_file($path) ) { 01226 throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE); 01227 } 01228 $filename = basename($path); 01229 if ( $name == '' ) { 01230 $name = $filename; 01231 } 01232 01233 $this->attachment[] = array( 01234 0 => $path, 01235 1 => $filename, 01236 2 => $name, 01237 3 => $encoding, 01238 4 => $type, 01239 5 => false, // isStringAttachment 01240 6 => 'attachment', 01241 7 => 0 01242 ); 01243 01244 } catch (phpmailerException $e) { 01245 $this->SetError($e->getMessage()); 01246 if ($this->exceptions) { 01247 throw $e; 01248 } 01249 echo $e->getMessage()."\n"; 01250 if ( $e->getCode() == self::STOP_CRITICAL ) { 01251 return false; 01252 } 01253 } 01254 return true; 01255 }

| PHPMailer::AddBCC | ( | $ | address, | |
| $ | name = '' | |||
| ) |
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
| string | $address | |
| string | $name |
Definiert in Zeile 383 der Datei class.phpmailer.php.
| PHPMailer::AddCC | ( | $ | address, | |
| $ | name = '' | |||
| ) |
Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
| string | $address | |
| string | $name |
Definiert in Zeile 372 der Datei class.phpmailer.php.
| PHPMailer::AddCustomHeader | ( | $ | custom_header | ) |
| PHPMailer::AddEmbeddedImage | ( | $ | path, | |
| $ | cid, | |||
| $ | name = '', |
|||
| $ | encoding = 'base64', |
|||
| $ | type = 'application/octet-stream' | |||
| ) |
Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
| string | $path Path to the attachment. | |
| string | $cid Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form. | |
| string | $name Overrides the attachment name. | |
| string | $encoding File encoding (see $Encoding). | |
| string | $type File extension (MIME) type. |
Definiert in Zeile 1662 der Datei class.phpmailer.php.
01662 { 01663 01664 if ( !@is_file($path) ) { 01665 $this->SetError($this->Lang('file_access') . $path); 01666 return false; 01667 } 01668 01669 $filename = basename($path); 01670 if ( $name == '' ) { 01671 $name = $filename; 01672 } 01673 01674 // Append to $attachment array 01675 $this->attachment[] = array( 01676 0 => $path, 01677 1 => $filename, 01678 2 => $name, 01679 3 => $encoding, 01680 4 => $type, 01681 5 => false, // isStringAttachment 01682 6 => 'inline', 01683 7 => $cid 01684 ); 01685 01686 return true; 01687 }


| PHPMailer::AddrAppend | ( | $ | type, | |
| $ | addr | |||
| ) |
Creates recipient headers. public
Definiert in Zeile 782 der Datei class.phpmailer.php.
00782 { 00783 $addr_str = $type . ': '; 00784 $addresses = array(); 00785 foreach ($addr as $a) { 00786 $addresses[] = $this->AddrFormat($a); 00787 } 00788 $addr_str .= implode(', ', $addresses); 00789 $addr_str .= $this->LE; 00790 00791 return $addr_str; 00792 }


| PHPMailer::AddReplyTo | ( | $ | address, | |
| $ | name = '' | |||
| ) |
Adds a "Reply-to" address.
| string | $address | |
| string | $name |
Definiert in Zeile 393 der Datei class.phpmailer.php.
| PHPMailer::AddrFormat | ( | $ | addr | ) |
Formats an address correctly. public
Definiert in Zeile 799 der Datei class.phpmailer.php.
00799 { 00800 if (empty($addr[1])) { 00801 return $this->SecureHeader($addr[0]); 00802 } else { 00803 return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; 00804 } 00805 }


| PHPMailer::AddStringAttachment | ( | $ | string, | |
| $ | filename, | |||
| $ | encoding = 'base64', |
|||
| $ | type = 'application/octet-stream' | |||
| ) |
Adds a string or binary attachment (non-filesystem) to the list. This method can be used to attach ascii or binary data, such as a BLOB record from a database.
| string | $string String attachment data. | |
| string | $filename Name of the attachment. | |
| string | $encoding File encoding (see $Encoding). | |
| string | $type File extension (MIME) type. |
Definiert in Zeile 1635 der Datei class.phpmailer.php.
01635 { 01636 // Append to $attachment array 01637 $this->attachment[] = array( 01638 0 => $string, 01639 1 => $filename, 01640 2 => $filename, 01641 3 => $encoding, 01642 4 => $type, 01643 5 => true, // isStringAttachment 01644 6 => 'attachment', 01645 7 => 0 01646 ); 01647 }
| PHPMailer::Base64EncodeWrapMB | ( | $ | str | ) |
Correctly encodes and wraps long multibyte strings for mail headers without breaking lines within a character. Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php public
| string | $str multi-byte text to wrap encode |
Definiert in Zeile 1478 der Datei class.phpmailer.php.
01478 { 01479 $start = "=?".$this->CharSet."?B?"; 01480 $end = "?="; 01481 $encoded = ""; 01482 01483 $mb_length = mb_strlen($str, $this->CharSet); 01484 // Each line must have length <= 75, including $start and $end 01485 $length = 75 - strlen($start) - strlen($end); 01486 // Average multi-byte ratio 01487 $ratio = $mb_length / strlen($str); 01488 // Base64 has a 4:3 ratio 01489 $offset = $avgLength = floor($length * $ratio * .75); 01490 01491 for ($i = 0; $i < $mb_length; $i += $offset) { 01492 $lookBack = 0; 01493 01494 do { 01495 $offset = $avgLength - $lookBack; 01496 $chunk = mb_substr($str, $i, $offset, $this->CharSet); 01497 $chunk = base64_encode($chunk); 01498 $lookBack++; 01499 } 01500 while (strlen($chunk) > $length); 01501 01502 $encoded .= $chunk . $this->LE; 01503 } 01504 01505 // Chomp the last linefeed 01506 $encoded = substr($encoded, 0, -strlen($this->LE)); 01507 return $encoded; 01508 }

| PHPMailer::ClearAddresses | ( | ) |
Clears all recipients assigned in the TO array. Returns void.
Definiert in Zeile 1711 der Datei class.phpmailer.php.
01711 { 01712 foreach($this->to as $to) { 01713 unset($this->all_recipients[strtolower($to[0])]); 01714 } 01715 $this->to = array(); 01716 }
| PHPMailer::ClearAllRecipients | ( | ) |
Clears all recipients assigned in the TO, CC and BCC array. Returns void.
Definiert in Zeile 1753 der Datei class.phpmailer.php.
01753 { 01754 $this->to = array(); 01755 $this->cc = array(); 01756 $this->bcc = array(); 01757 $this->all_recipients = array(); 01758 }
| PHPMailer::ClearAttachments | ( | ) |
Clears all previously set filesystem, string, and binary attachments. Returns void.
Definiert in Zeile 1765 der Datei class.phpmailer.php.
| PHPMailer::ClearBCCs | ( | ) |
Clears all recipients assigned in the BCC array. Returns void.
Definiert in Zeile 1733 der Datei class.phpmailer.php.
01733 { 01734 foreach($this->bcc as $bcc) { 01735 unset($this->all_recipients[strtolower($bcc[0])]); 01736 } 01737 $this->bcc = array(); 01738 }
| PHPMailer::ClearCCs | ( | ) |
Clears all recipients assigned in the CC array. Returns void.
Definiert in Zeile 1722 der Datei class.phpmailer.php.
01722 { 01723 foreach($this->cc as $cc) { 01724 unset($this->all_recipients[strtolower($cc[0])]); 01725 } 01726 $this->cc = array(); 01727 }
| PHPMailer::ClearCustomHeaders | ( | ) |
Clears all custom headers. Returns void.
Definiert in Zeile 1773 der Datei class.phpmailer.php.
| PHPMailer::ClearReplyTos | ( | ) |
Clears all recipients assigned in the ReplyTo array. Returns void.
Definiert in Zeile 1744 der Datei class.phpmailer.php.
| PHPMailer::CreateBody | ( | ) |
Assembles the message body. Returns an empty string on failure. public
Definiert in Zeile 1069 der Datei class.phpmailer.php.
01069 { 01070 $body = ''; 01071 01072 if ($this->sign_key_file) { 01073 $body .= $this->GetMailMIME(); 01074 } 01075 01076 $this->SetWordWrap(); 01077 01078 switch($this->message_type) { 01079 case 'alt': 01080 $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); 01081 $body .= $this->EncodeString($this->AltBody, $this->Encoding); 01082 $body .= $this->LE.$this->LE; 01083 $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); 01084 $body .= $this->EncodeString($this->Body, $this->Encoding); 01085 $body .= $this->LE.$this->LE; 01086 $body .= $this->EndBoundary($this->boundary[1]); 01087 break; 01088 case 'plain': 01089 $body .= $this->EncodeString($this->Body, $this->Encoding); 01090 break; 01091 case 'attachments': 01092 $body .= $this->GetBoundary($this->boundary[1], '', '', ''); 01093 $body .= $this->EncodeString($this->Body, $this->Encoding); 01094 $body .= $this->LE; 01095 $body .= $this->AttachAll(); 01096 break; 01097 case 'alt_attachments': 01098 $body .= sprintf("--%s%s", $this->boundary[1], $this->LE); 01099 $body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); 01100 $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body 01101 $body .= $this->EncodeString($this->AltBody, $this->Encoding); 01102 $body .= $this->LE.$this->LE; 01103 $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body 01104 $body .= $this->EncodeString($this->Body, $this->Encoding); 01105 $body .= $this->LE.$this->LE; 01106 $body .= $this->EndBoundary($this->boundary[2]); 01107 $body .= $this->AttachAll(); 01108 break; 01109 } 01110 01111 if ($this->IsError()) { 01112 $body = ''; 01113 } elseif ($this->sign_key_file) { 01114 try { 01115 $file = tempnam('', 'mail'); 01116 file_put_contents($file, $body); //TODO check this worked 01117 $signed = tempnam("", "signed"); 01118 if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { 01119 @unlink($file); 01120 @unlink($signed); 01121 $body = file_get_contents($signed); 01122 } else { 01123 @unlink($file); 01124 @unlink($signed); 01125 throw new phpmailerException($this->Lang("signing").openssl_error_string()); 01126 } 01127 } catch (phpmailerException $e) { 01128 $body = ''; 01129 if ($this->exceptions) { 01130 throw $e; 01131 } 01132 } 01133 } 01134 01135 return $body; 01136 }


| PHPMailer::CreateHeader | ( | ) |
Assembles message header. public
Definiert in Zeile 958 der Datei class.phpmailer.php.
00958 { 00959 $result = ''; 00960 00961 // Set the boundaries 00962 $uniq_id = md5(uniqid(time())); 00963 $this->boundary[1] = 'b1_' . $uniq_id; 00964 $this->boundary[2] = 'b2_' . $uniq_id; 00965 00966 $result .= $this->HeaderLine('Date', self::RFCDate()); 00967 if($this->Sender == '') { 00968 $result .= $this->HeaderLine('Return-Path', trim($this->From)); 00969 } else { 00970 $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); 00971 } 00972 00973 // To be created automatically by mail() 00974 if($this->Mailer != 'mail') { 00975 if(count($this->to) > 0) { 00976 $result .= $this->AddrAppend('To', $this->to); 00977 } elseif (count($this->cc) == 0) { 00978 $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); 00979 } 00980 } 00981 00982 $from = array(); 00983 $from[0][0] = trim($this->From); 00984 $from[0][1] = $this->FromName; 00985 $result .= $this->AddrAppend('From', $from); 00986 00987 // sendmail and mail() extract Cc from the header before sending 00988 if(count($this->cc) > 0) { 00989 $result .= $this->AddrAppend('Cc', $this->cc); 00990 } 00991 00992 // sendmail and mail() extract Bcc from the header before sending 00993 if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { 00994 $result .= $this->AddrAppend('Bcc', $this->bcc); 00995 } 00996 00997 if(count($this->ReplyTo) > 0) { 00998 $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); 00999 } 01000 01001 // mail() sets the subject itself 01002 if($this->Mailer != 'mail') { 01003 $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); 01004 } 01005 01006 if($this->MessageID != '') { 01007 $result .= $this->HeaderLine('Message-ID',$this->MessageID); 01008 } else { 01009 $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); 01010 } 01011 $result .= $this->HeaderLine('X-Priority', $this->Priority); 01012 $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (phpmailer.codeworxtech.com)'); 01013 01014 if($this->ConfirmReadingTo != '') { 01015 $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); 01016 } 01017 01018 // Add custom headers 01019 for($index = 0; $index < count($this->CustomHeader); $index++) { 01020 $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); 01021 } 01022 if (!$this->sign_key_file) { 01023 $result .= $this->HeaderLine('MIME-Version', '1.0'); 01024 $result .= $this->GetMailMIME(); 01025 } 01026 01027 return $result; 01028 }


| PHPMailer::EncodeHeader | ( | $ | str, | |
| $ | position = 'text' | |||
| ) |
Encode a header string to best (shortest) of Q, B, quoted or none. public
Definiert in Zeile 1401 der Datei class.phpmailer.php.
01401 { 01402 $x = 0; 01403 01404 switch (strtolower($position)) { 01405 case 'phrase': 01406 if (!preg_match('/[\200-\377]/', $str)) { 01407 // Can't use addslashes as we don't know what value has magic_quotes_sybase 01408 $encoded = addcslashes($str, "\0..\37\177\\\""); 01409 if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { 01410 return ($encoded); 01411 } else { 01412 return ("\"$encoded\""); 01413 } 01414 } 01415 $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); 01416 break; 01417 case 'comment': 01418 $x = preg_match_all('/[()"]/', $str, $matches); 01419 // Fall-through 01420 case 'text': 01421 default: 01422 $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); 01423 break; 01424 } 01425 01426 if ($x == 0) { 01427 return ($str); 01428 } 01429 01430 $maxlen = 75 - 7 - strlen($this->CharSet); 01431 // Try to select the encoding which should produce the shortest output 01432 if (strlen($str)/3 < $x) { 01433 $encoding = 'B'; 01434 if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { 01435 // Use a custom function which correctly encodes and wraps long 01436 // multibyte strings without breaking lines within a character 01437 $encoded = $this->Base64EncodeWrapMB($str); 01438 } else { 01439 $encoded = base64_encode($str); 01440 $maxlen -= $maxlen % 4; 01441 $encoded = trim(chunk_split($encoded, $maxlen, "\n")); 01442 } 01443 } else { 01444 $encoding = 'Q'; 01445 $encoded = $this->EncodeQ($str, $position); 01446 $encoded = $this->WrapText($encoded, $maxlen, true); 01447 $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); 01448 } 01449 01450 $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); 01451 $encoded = trim(str_replace("\n", $this->LE, $encoded)); 01452 01453 return $encoded; 01454 }


| PHPMailer::EncodeQ | ( | $ | str, | |
| $ | position = 'text' | |||
| ) |
Encode string to q encoding. string $str the text to encode string $position Where the text is going to be used, see the RFC for what that means public string
Definiert in Zeile 1600 der Datei class.phpmailer.php.
01600 { 01601 // There should not be any EOL in the string 01602 $encoded = preg_replace('/[\r\n]*/', '', $str); 01603 01604 switch (strtolower($position)) { 01605 case 'phrase': 01606 $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); 01607 break; 01608 case 'comment': 01609 $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); 01610 case 'text': 01611 default: 01612 // Replace every high ascii, control =, ? and _ characters 01613 //TODO using /e (equivalent to eval()) is probably not a good idea 01614 $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', 01615 "'='.sprintf('%02X', ord('\\1'))", $encoded); 01616 break; 01617 } 01618 01619 // Replace every spaces to _ (more readable than =20) 01620 $encoded = str_replace(' ', '_', $encoded); 01621 01622 return $encoded; 01623 }

| PHPMailer::EncodeQP | ( | $ | string, | |
| $ | line_max = 76, |
|||
| $ | space_conv = false | |||
| ) |
Encode string to RFC2045 (6.7) quoted-printable format Uses a PHP5 stream filter to do the encoding about 64x faster than the old version Also results in same content as you started with after decoding
| string | $string the text to encode | |
| integer | $line_max Number of chars allowed on a line before wrapping | |
| boolean | $space_conv Dummy param for compatibility with existing EncodeQP function |
Definiert in Zeile 1571 der Datei class.phpmailer.php.
01571 { 01572 if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) 01573 return quoted_printable_encode($string); 01574 } 01575 $filters = stream_get_filters(); 01576 if (!in_array('convert.*', $filters)) { //Got convert stream filter? 01577 return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation 01578 } 01579 $fp = fopen('php://temp/', 'r+'); 01580 $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks 01581 $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE); 01582 $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params); 01583 fputs($fp, $string); 01584 rewind($fp); 01585 $out = stream_get_contents($fp); 01586 stream_filter_remove($s); 01587 $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange 01588 fclose($fp); 01589 return $out; 01590 }


| PHPMailer::EncodeQPphp | ( | $ | input = '', |
|
| $ | line_max = 76, |
|||
| $ | space_conv = false | |||
| ) |
Encode string to quoted-printable. Only uses standard PHP, slow, but will always work public
| string | $string the text to encode | |
| integer | $line_max Number of chars allowed on a line before wrapping |
Definiert in Zeile 1518 der Datei class.phpmailer.php.
01518 { 01519 $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); 01520 $lines = preg_split('/(?:\r\n|\r|\n)/', $input); 01521 $eol = "\r\n"; 01522 $escape = '='; 01523 $output = ''; 01524 while( list(, $line) = each($lines) ) { 01525 $linlen = strlen($line); 01526 $newline = ''; 01527 for($i = 0; $i < $linlen; $i++) { 01528 $c = substr( $line, $i, 1 ); 01529 $dec = ord( $c ); 01530 if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E 01531 $c = '=2E'; 01532 } 01533 if ( $dec == 32 ) { 01534 if ( $i == ( $linlen - 1 ) ) { // convert space at eol only 01535 $c = '=20'; 01536 } else if ( $space_conv ) { 01537 $c = '=20'; 01538 } 01539 } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required 01540 $h2 = floor($dec/16); 01541 $h1 = floor($dec%16); 01542 $c = $escape.$hex[$h2].$hex[$h1]; 01543 } 01544 if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted 01545 $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay 01546 $newline = ''; 01547 // check if newline first character will be point or not 01548 if ( $dec == 46 ) { 01549 $c = '=2E'; 01550 } 01551 } 01552 $newline .= $c; 01553 } // end of for 01554 $output .= $newline.$eol; 01555 } // end of while 01556 return $output; 01557 }

| PHPMailer::EncodeString | ( | $ | str, | |
| $ | encoding = 'base64' | |||
| ) |
Encodes string to requested format. Returns an empty string on failure.
| string | $str The text to encode | |
| string | $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' public |
Definiert in Zeile 1370 der Datei class.phpmailer.php.
01370 { 01371 $encoded = ''; 01372 switch(strtolower($encoding)) { 01373 case 'base64': 01374 $encoded = chunk_split(base64_encode($str), 76, $this->LE); 01375 break; 01376 case '7bit': 01377 case '8bit': 01378 $encoded = $this->FixEOL($str); 01379 //Make sure it ends with a line break 01380 if (substr($encoded, -(strlen($this->LE))) != $this->LE) 01381 $encoded .= $this->LE; 01382 break; 01383 case 'binary': 01384 $encoded = $str; 01385 break; 01386 case 'quoted-printable': 01387 $encoded = $this->EncodeQP($str); 01388 break; 01389 default: 01390 $this->SetError($this->Lang('encoding') . $encoding); 01391 break; 01392 } 01393 return $encoded; 01394 }


| PHPMailer::GetAttachments | ( | ) |
Return the current array of attachments
Definiert in Zeile 1261 der Datei class.phpmailer.php.
| PHPMailer::GetMailMIME | ( | ) |
Returns the message MIME. public
Definiert in Zeile 1035 der Datei class.phpmailer.php.
01035 { 01036 $result = ''; 01037 switch($this->message_type) { 01038 case 'plain': 01039 $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); 01040 $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); 01041 break; 01042 case 'attachments': 01043 case 'alt_attachments': 01044 if($this->InlineImageExists()){ 01045 $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE); 01046 } else { 01047 $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;'); 01048 $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); 01049 } 01050 break; 01051 case 'alt': 01052 $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); 01053 $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); 01054 break; 01055 } 01056 01057 if($this->Mailer != 'mail') { 01058 $result .= $this->LE.$this->LE; 01059 } 01060 01061 return $result; 01062 }


| PHPMailer::GetTranslations | ( | ) |
Return the current array of language strings
Definiert in Zeile 769 der Datei class.phpmailer.php.
| PHPMailer::HasMultiBytes | ( | $ | str | ) |
Checks if a string contains multibyte characters. public
| string | $str multi-byte text to wrap encode |
Definiert in Zeile 1462 der Datei class.phpmailer.php.
01462 { 01463 if (function_exists('mb_strlen')) { 01464 return (strlen($str) > mb_strlen($str, $this->CharSet)); 01465 } else { // Assume no multibytes (we can't handle without mbstring functions anyway) 01466 return false; 01467 } 01468 }

| PHPMailer::HeaderLine | ( | $ | name, | |
| $ | value | |||
| ) |
Returns a formatted header line. public
Definiert in Zeile 1196 der Datei class.phpmailer.php.

| PHPMailer::InlineImageExists | ( | ) |
Returns true if an inline attachment is present. public
Definiert in Zeile 1694 der Datei class.phpmailer.php.
01694 { 01695 foreach($this->attachment as $attachment) { 01696 if ($attachment[6] == 'inline') { 01697 return true; 01698 } 01699 } 01700 return false; 01701 }

| PHPMailer::IsError | ( | ) |
Returns true if an error occurred. public
Definiert in Zeile 1852 der Datei class.phpmailer.php.

| PHPMailer::IsHTML | ( | $ | ishtml = true |
) |
Sets message type to HTML.
| bool | $ishtml |
Definiert in Zeile 305 der Datei class.phpmailer.php.
00305 { 00306 if ($ishtml) { 00307 $this->ContentType = 'text/html'; 00308 } else { 00309 $this->ContentType = 'text/plain'; 00310 } 00311 }

| PHPMailer::IsMail | ( | ) |
Sets Mailer to send message using PHP mail() function.
Definiert in Zeile 325 der Datei class.phpmailer.php.
| PHPMailer::IsQmail | ( | ) |
Sets Mailer to send message using the qmail MTA.
Definiert in Zeile 344 der Datei class.phpmailer.php.
00344 { 00345 if (stristr(ini_get('sendmail_path'), 'qmail')) { 00346 $this->Sendmail = '/var/qmail/bin/sendmail'; 00347 } 00348 $this->Mailer = 'sendmail'; 00349 }
| PHPMailer::IsSendmail | ( | ) |
Sets Mailer to send message using the $Sendmail program.
Definiert in Zeile 333 der Datei class.phpmailer.php.
00333 { 00334 if (!stristr(ini_get('sendmail_path'), 'sendmail')) { 00335 $this->Sendmail = '/var/qmail/bin/sendmail'; 00336 } 00337 $this->Mailer = 'sendmail'; 00338 }
| PHPMailer::IsSMTP | ( | ) |
Sets Mailer to send message using SMTP.
Definiert in Zeile 317 der Datei class.phpmailer.php.
| PHPMailer::MailSend | ( | $ | header, | |
| $ | body | |||
| ) | [protected] |
Sends mail using the PHP mail() function.
| string | $header The message headers | |
| string | $body The message body protected |
Definiert in Zeile 564 der Datei class.phpmailer.php.
00564 { 00565 $toArr = array(); 00566 foreach($this->to as $t) { 00567 $toArr[] = $this->AddrFormat($t); 00568 } 00569 $to = implode(', ', $toArr); 00570 00571 $params = sprintf("-oi -f %s", $this->Sender); 00572 if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { 00573 $old_from = ini_get('sendmail_from'); 00574 ini_set('sendmail_from', $this->Sender); 00575 if ($this->SingleTo === true && count($toArr) > 1) { 00576 foreach ($toArr as $key => $val) { 00577 $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); 00578 } 00579 } else { 00580 $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); 00581 } 00582 } else { 00583 if ($this->SingleTo === true && count($toArr) > 1) { 00584 foreach ($toArr as $key => $val) { 00585 $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); 00586 } 00587 } else { 00588 $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); 00589 } 00590 } 00591 if (isset($old_from)) { 00592 ini_set('sendmail_from', $old_from); 00593 } 00594 if(!$rt) { 00595 throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL); 00596 } 00597 return true; 00598 }


| PHPMailer::MsgHTML | ( | $ | message, | |
| $ | basedir = '' | |||
| ) |
Evaluates the message and returns modifications for inline images and backgrounds public
Definiert in Zeile 1882 der Datei class.phpmailer.php.
01882 { 01883 preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); 01884 if(isset($images[2])) { 01885 foreach($images[2] as $i => $url) { 01886 // do not change urls for absolute images (thanks to corvuscorax) 01887 if (!preg_match('#^[A-z]+://#',$url)) { 01888 $filename = basename($url); 01889 $directory = dirname($url); 01890 ($directory == '.')?$directory='':''; 01891 $cid = 'cid:' . md5($filename); 01892 $ext = pathinfo($filename, PATHINFO_EXTENSION); 01893 $mimeType = self::_mime_types($ext); 01894 if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } 01895 if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } 01896 if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { 01897 $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); 01898 } 01899 } 01900 } 01901 } 01902 $this->IsHTML(true); 01903 $this->Body = $message; 01904 $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); 01905 if (!empty($textMsg) && empty($this->AltBody)) { 01906 $this->AltBody = html_entity_decode($textMsg); 01907 } 01908 if (empty($this->AltBody)) { 01909 $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; 01910 } 01911 }

| static PHPMailer::RFCDate | ( | ) | [static] |
Returns the proper RFC 822 formatted date. public
Definiert in Zeile 1803 der Datei class.phpmailer.php.
01803 { 01804 $tz = date('Z'); 01805 $tzs = ($tz < 0) ? '-' : '+'; 01806 $tz = abs($tz); 01807 $tz = (int)($tz/3600)*100 + ($tz%3600)/60; 01808 $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); 01809 01810 return $result; 01811 }
| PHPMailer::SecureHeader | ( | $ | str | ) |
Strips newlines to prevent header injection. public
| string | $str String |
Definiert in Zeile 2047 der Datei class.phpmailer.php.
02047 { 02048 $str = str_replace("\r", '', $str); 02049 $str = str_replace("\n", '', $str); 02050 return trim($str); 02051 }

| PHPMailer::Send | ( | ) |
Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
Definiert in Zeile 491 der Datei class.phpmailer.php.
00491 { 00492 try { 00493 if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { 00494 throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); 00495 } 00496 00497 // Set whether the message is multipart/alternative 00498 if(!empty($this->AltBody)) { 00499 $this->ContentType = 'multipart/alternative'; 00500 } 00501 00502 $this->error_count = 0; // reset errors 00503 $this->SetMessageType(); 00504 $header = $this->CreateHeader(); 00505 $body = $this->CreateBody(); 00506 00507 if (empty($this->Body)) { 00508 throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); 00509 } 00510 00511 // Choose the mailer and send through it 00512 switch($this->Mailer) { 00513 case 'sendmail': 00514 return $this->SendmailSend($header, $body); 00515 case 'smtp': 00516 return $this->SmtpSend($header, $body); 00517 case 'mail': 00518 default: 00519 return $this->MailSend($header, $body); 00520 } 00521 00522 } catch (phpmailerException $e) { 00523 $this->SetError($e->getMessage()); 00524 if ($this->exceptions) { 00525 throw $e; 00526 } 00527 echo $e->getMessage()."\n"; 00528 return false; 00529 } 00530 }

| PHPMailer::SendmailSend | ( | $ | header, | |
| $ | body | |||
| ) | [protected] |
Sends mail using the $Sendmail program.
| string | $header The message headers | |
| string | $body The message body protected |
Definiert in Zeile 539 der Datei class.phpmailer.php.
00539 { 00540 if ($this->Sender != '') { 00541 $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 00542 } else { 00543 $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 00544 } 00545 if(!@$mail = popen($sendmail, 'w')) { 00546 throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); 00547 } 00548 fputs($mail, $header); 00549 fputs($mail, $body); 00550 $result = pclose($mail); 00551 if($result != 0) { 00552 throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); 00553 } 00554 return true; 00555 }

| PHPMailer::set | ( | $ | name, | |
| $ | value = '' | |||
| ) |
Set (or reset) Class Objects (variables)
Usage Example: $page->set('X-Priority', '3');
public
| string | $name Parameter Name | |
| mixed | $value Parameter Value NOTE: will not work with arrays, there are no arrays to set/reset |
Definiert in Zeile 2025 der Datei class.phpmailer.php.
02025 { 02026 try { 02027 if (isset($this->$name) ) { 02028 $this->$name = $value; 02029 } else { 02030 throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL); 02031 } 02032 } catch (Exception $e) { 02033 $this->SetError($e->getMessage()); 02034 if ($e->getCode() == self::STOP_CRITICAL) { 02035 return false; 02036 } 02037 } 02038 return true; 02039 }

| PHPMailer::SetError | ( | $ | msg | ) | [protected] |
Adds the error message to the error container. protected
Definiert in Zeile 1786 der Datei class.phpmailer.php.
01786 { 01787 $this->error_count++; 01788 if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { 01789 $lasterror = $this->smtp->getError(); 01790 if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { 01791 $msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n"; 01792 } 01793 } 01794 $this->ErrorInfo = $msg; 01795 }

| PHPMailer::SetFrom | ( | $ | address, | |
| $ | name = '' | |||
| ) |
Set the From and FromName properties
| string | $address | |
| string | $name |
Definiert in Zeile 442 der Datei class.phpmailer.php.
00442 { 00443 $address = trim($address); 00444 $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim 00445 if (!self::ValidateAddress($address)) { 00446 $this->SetError($this->Lang('invalid_address').': '. $address); 00447 if ($this->exceptions) { 00448 throw new phpmailerException($this->Lang('invalid_address').': '.$address); 00449 } 00450 echo $this->Lang('invalid_address').': '.$address; 00451 return false; 00452 } 00453 $this->From = $address; 00454 $this->FromName = $name; 00455 return true; 00456 }

| PHPMailer::SetLanguage | ( | $ | langcode = 'en', |
|
| $ | lang_path = 'language/' | |||
| ) |
Sets the language for all class error messages. Returns false if it cannot load the language file. The default language is English.
| string | $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") | |
| string | $lang_path Path to the language file directory public |
Definiert in Zeile 735 der Datei class.phpmailer.php.
00735 { 00736 //Define full set of translatable strings 00737 $PHPMAILER_LANG = array( 00738 'provide_address' => 'You must provide at least one recipient email address.', 00739 'mailer_not_supported' => ' mailer is not supported.', 00740 'execute' => 'Could not execute: ', 00741 'instantiate' => 'Could not instantiate mail function.', 00742 'authenticate' => 'SMTP Error: Could not authenticate.', 00743 'from_failed' => 'The following From address failed: ', 00744 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 00745 'data_not_accepted' => 'SMTP Error: Data not accepted.', 00746 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 00747 'file_access' => 'Could not access file: ', 00748 'file_open' => 'File Error: Could not open file: ', 00749 'encoding' => 'Unknown encoding: ', 00750 'signing' => 'Signing Error: ', 00751 'smtp_error' => 'SMTP server error: ', 00752 'empty_message' => 'Message body empty', 00753 'invalid_address' => 'Invalid address', 00754 'variable_set' => 'Cannot set or reset variable: ' 00755 ); 00756 //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! 00757 $l = true; 00758 if ($langcode != 'en') { //There is no English translation file 00759 $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; 00760 } 00761 $this->language = $PHPMAILER_LANG; 00762 return ($l == true); //Returns false if language not found 00763 }
| PHPMailer::SetWordWrap | ( | ) |
Set the body wrapping. public
Definiert in Zeile 937 der Datei class.phpmailer.php.
00937 { 00938 if($this->WordWrap < 1) { 00939 return; 00940 } 00941 00942 switch($this->message_type) { 00943 case 'alt': 00944 case 'alt_attachments': 00945 $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); 00946 break; 00947 default: 00948 $this->Body = $this->WrapText($this->Body, $this->WordWrap); 00949 break; 00950 } 00951 }


| PHPMailer::Sign | ( | $ | cert_filename, | |
| $ | key_filename, | |||
| $ | key_pass | |||
| ) |
Set the private key file and password to sign the message.
public
| string | $key_filename Parameter File Name | |
| string | $key_pass Password for private key |
Definiert in Zeile 2060 der Datei class.phpmailer.php.
02060 { 02061 $this->sign_cert_file = $cert_filename; 02062 $this->sign_key_file = $key_filename; 02063 $this->sign_key_pass = $key_pass; 02064 }
| PHPMailer::SmtpClose | ( | ) |
Closes the active SMTP session if one exists.
Definiert in Zeile 719 der Datei class.phpmailer.php.
00719 { 00720 if(!is_null($this->smtp)) { 00721 if($this->smtp->Connected()) { 00722 $this->smtp->Quit(); 00723 $this->smtp->Close(); 00724 } 00725 } 00726 }
| PHPMailer::SmtpConnect | ( | ) |
Initiates a connection to an SMTP server. Returns false if the operation failed. SMTP public
Definiert in Zeile 657 der Datei class.phpmailer.php.
00657 { 00658 if(is_null($this->smtp)) { 00659 $this->smtp = new SMTP(); 00660 } 00661 00662 $this->smtp->do_debug = $this->SMTPDebug; 00663 $hosts = explode(';', $this->Host); 00664 $index = 0; 00665 $connection = $this->smtp->Connected(); 00666 00667 // Retry while there is no connection 00668 try { 00669 while($index < count($hosts) && !$connection) { 00670 $hostinfo = array(); 00671 if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) { 00672 $host = $hostinfo[1]; 00673 $port = $hostinfo[2]; 00674 } else { 00675 $host = $hosts[$index]; 00676 $port = $this->Port; 00677 } 00678 00679 $tls = ($this->SMTPSecure == 'tls'); 00680 $ssl = ($this->SMTPSecure == 'ssl'); 00681 00682 if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { 00683 00684 $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); 00685 $this->smtp->Hello($hello); 00686 00687 if ($tls) { 00688 if (!$this->smtp->StartTLS()) { 00689 throw new phpmailerException($this->Lang('tls')); 00690 } 00691 00692 //We must resend HELO after tls negotiation 00693 $this->smtp->Hello($hello); 00694 } 00695 00696 $connection = true; 00697 if ($this->SMTPAuth) { 00698 if (!$this->smtp->Authenticate($this->Username, $this->Password)) { 00699 throw new phpmailerException($this->Lang('authenticate')); 00700 } 00701 } 00702 } 00703 $index++; 00704 if (!$connection) { 00705 throw new phpmailerException($this->Lang('connect_host')); 00706 } 00707 } 00708 } catch (phpmailerException $e) { 00709 $this->smtp->Reset(); 00710 throw $e; 00711 } 00712 return true; 00713 }

| PHPMailer::SmtpSend | ( | $ | header, | |
| $ | body | |||
| ) | [protected] |
Sends mail via SMTP using PhpSMTP Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
| string | $header The message headers | |
| string | $body The message body SMTP protected |
Definiert in Zeile 609 der Datei class.phpmailer.php.
00609 { 00610 require_once $this->PluginDir . 'class.smtp.php'; 00611 $bad_rcpt = array(); 00612 00613 if(!$this->SmtpConnect()) { 00614 throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL); 00615 } 00616 $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; 00617 if(!$this->smtp->Mail($smtp_from)) { 00618 throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); 00619 } 00620 00621 // Attempt to send attach all recipients 00622 foreach($this->to as $to) { 00623 if (!$this->smtp->Recipient($to[0])) { 00624 $bad_rcpt[] = $to[0]; 00625 } 00626 } 00627 foreach($this->cc as $cc) { 00628 if (!$this->smtp->Recipient($cc[0])) { 00629 $bad_rcpt[] = $cc[0]; 00630 } 00631 } 00632 foreach($this->bcc as $bcc) { 00633 if (!$this->smtp->Recipient($bcc[0])) { 00634 $bad_rcpt[] = $bcc[0]; 00635 } 00636 } 00637 if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses 00638 $badaddresses = implode(', ', $bad_rcpt); 00639 throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses); 00640 } 00641 if(!$this->smtp->Data($header . $body)) { 00642 throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL); 00643 } 00644 if($this->SMTPKeepAlive == true) { 00645 $this->smtp->Reset(); 00646 } 00647 return true; 00648 }


| PHPMailer::TextLine | ( | $ | value | ) |
Returns a formatted mail line. public
Definiert in Zeile 1205 der Datei class.phpmailer.php.

| PHPMailer::UTF8CharBoundary | ( | $ | encodedText, | |
| $ | maxLength | |||
| ) |
Finds last character boundary prior to maxLength in a utf-8 quoted (printable) encoded string. Original written by Colin Brown. public
| string | $encodedText utf-8 QP text | |
| int | $maxLength find last character boundary prior to this length |
Definiert in Zeile 899 der Datei class.phpmailer.php.
00899 { 00900 $foundSplitPos = false; 00901 $lookBack = 3; 00902 while (!$foundSplitPos) { 00903 $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); 00904 $encodedCharPos = strpos($lastChunk, "="); 00905 if ($encodedCharPos !== false) { 00906 // Found start of encoded character byte within $lookBack block. 00907 // Check the encoded byte value (the 2 chars after the '=') 00908 $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); 00909 $dec = hexdec($hex); 00910 if ($dec < 128) { // Single byte character. 00911 // If the encoded char was found at pos 0, it will fit 00912 // otherwise reduce maxLength to start of the encoded char 00913 $maxLength = ($encodedCharPos == 0) ? $maxLength : 00914 $maxLength - ($lookBack - $encodedCharPos); 00915 $foundSplitPos = true; 00916 } elseif ($dec >= 192) { // First byte of a multi byte character 00917 // Reduce maxLength to split at start of character 00918 $maxLength = $maxLength - ($lookBack - $encodedCharPos); 00919 $foundSplitPos = true; 00920 } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back 00921 $lookBack += 3; 00922 } 00923 } else { 00924 // No encoded character found 00925 $foundSplitPos = true; 00926 } 00927 } 00928 return $maxLength; 00929 }

| static PHPMailer::ValidateAddress | ( | $ | address | ) | [static] |
Check that a string looks roughly like an email address should Static so it can be used without instantiation Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator Conforms approximately to RFC2822 Original pattern found here string $address The email address to check boolean public
Definiert in Zeile 469 der Datei class.phpmailer.php.
00469 { 00470 if (function_exists('filter_var')) { //Introduced in PHP 5.2 00471 if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { 00472 return false; 00473 } else { 00474 return true; 00475 } 00476 } else { 00477 return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); 00478 } 00479 }
| PHPMailer::WrapText | ( | $ | message, | |
| $ | length, | |||
| $ | qp_mode = false | |||
| ) |
Wraps message for use with mailers that do not automatically perform wrapping and for quoted-printable. Original written by philippe.
| string | $message The message to wrap | |
| integer | $length The line length to wrap to | |
| boolean | $qp_mode Whether to run in Quoted-Printable mode public |
Definiert in Zeile 817 der Datei class.phpmailer.php.
00817 { 00818 $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; 00819 // If utf-8 encoding is used, we will need to make sure we don't 00820 // split multibyte characters when we wrap 00821 $is_utf8 = (strtolower($this->CharSet) == "utf-8"); 00822 00823 $message = $this->FixEOL($message); 00824 if (substr($message, -1) == $this->LE) { 00825 $message = substr($message, 0, -1); 00826 } 00827 00828 $line = explode($this->LE, $message); 00829 $message = ''; 00830 for ($i=0 ;$i < count($line); $i++) { 00831 $line_part = explode(' ', $line[$i]); 00832 $buf = ''; 00833 for ($e = 0; $e<count($line_part); $e++) { 00834 $word = $line_part[$e]; 00835 if ($qp_mode and (strlen($word) > $length)) { 00836 $space_left = $length - strlen($buf) - 1; 00837 if ($e != 0) { 00838 if ($space_left > 20) { 00839 $len = $space_left; 00840 if ($is_utf8) { 00841 $len = $this->UTF8CharBoundary($word, $len); 00842 } elseif (substr($word, $len - 1, 1) == "=") { 00843 $len--; 00844 } elseif (substr($word, $len - 2, 1) == "=") { 00845 $len -= 2; 00846 } 00847 $part = substr($word, 0, $len); 00848 $word = substr($word, $len); 00849 $buf .= ' ' . $part; 00850 $message .= $buf . sprintf("=%s", $this->LE); 00851 } else { 00852 $message .= $buf . $soft_break; 00853 } 00854 $buf = ''; 00855 } 00856 while (strlen($word) > 0) { 00857 $len = $length; 00858 if ($is_utf8) { 00859 $len = $this->UTF8CharBoundary($word, $len); 00860 } elseif (substr($word, $len - 1, 1) == "=") { 00861 $len--; 00862 } elseif (substr($word, $len - 2, 1) == "=") { 00863 $len -= 2; 00864 } 00865 $part = substr($word, 0, $len); 00866 $word = substr($word, $len); 00867 00868 if (strlen($word) > 0) { 00869 $message .= $part . sprintf("=%s", $this->LE); 00870 } else { 00871 $buf = $part; 00872 } 00873 } 00874 } else { 00875 $buf_o = $buf; 00876 $buf .= ($e == 0) ? $word : (' ' . $word); 00877 00878 if (strlen($buf) > $length and $buf_o != '') { 00879 $message .= $buf_o . $soft_break; 00880 $buf = $word; 00881 } 00882 } 00883 } 00884 $message .= $buf . $this->LE; 00885 } 00886 00887 return $message; 00888 }


| PHPMailer::$AltBody = '' |
Definiert in Zeile 119 der Datei class.phpmailer.php.
| PHPMailer::$Body = '' |
Definiert in Zeile 110 der Datei class.phpmailer.php.
| PHPMailer::$CharSet = 'iso-8859-1' |
Definiert in Zeile 59 der Datei class.phpmailer.php.
| PHPMailer::$ConfirmReadingTo = '' |
Definiert in Zeile 151 der Datei class.phpmailer.php.
| PHPMailer::$ContentType = 'text/plain' |
Definiert in Zeile 65 der Datei class.phpmailer.php.
| PHPMailer::$Encoding = '8bit' |
Definiert in Zeile 72 der Datei class.phpmailer.php.
| PHPMailer::$ErrorInfo = '' |
Definiert in Zeile 78 der Datei class.phpmailer.php.
| PHPMailer::$From = 'root@localhost' |
Definiert in Zeile 84 der Datei class.phpmailer.php.
| PHPMailer::$FromName = 'Root User' |
Definiert in Zeile 90 der Datei class.phpmailer.php.
| PHPMailer::$Helo = '' |
Definiert in Zeile 192 der Datei class.phpmailer.php.
| PHPMailer::$Host = 'localhost' |
Definiert in Zeile 180 der Datei class.phpmailer.php.
| PHPMailer::$Hostname = '' |
Definiert in Zeile 159 der Datei class.phpmailer.php.
PHPMailer::$language = array() [protected] |
Definiert in Zeile 273 der Datei class.phpmailer.php.
| PHPMailer::$LE = "\n" |
Definiert in Zeile 251 der Datei class.phpmailer.php.
| PHPMailer::$Mailer = 'mail' |
Definiert in Zeile 132 der Datei class.phpmailer.php.
| PHPMailer::$MessageID = '' |
Definiert in Zeile 166 der Datei class.phpmailer.php.
| PHPMailer::$Password = '' |
Definiert in Zeile 217 der Datei class.phpmailer.php.
| PHPMailer::$PluginDir = '' |
Definiert in Zeile 145 der Datei class.phpmailer.php.
| PHPMailer::$Port = 25 |
Definiert in Zeile 186 der Datei class.phpmailer.php.
| PHPMailer::$Priority = 3 |
Definiert in Zeile 53 der Datei class.phpmailer.php.
| PHPMailer::$Sender = '' |
Definiert in Zeile 97 der Datei class.phpmailer.php.
| PHPMailer::$Sendmail = '/usr/sbin/sendmail' |
Definiert in Zeile 138 der Datei class.phpmailer.php.
| PHPMailer::$SingleTo = false |
Definiert in Zeile 245 der Datei class.phpmailer.php.
| PHPMailer::$SMTPAuth = false |
Definiert in Zeile 205 der Datei class.phpmailer.php.
| PHPMailer::$SMTPDebug = false |
Definiert in Zeile 230 der Datei class.phpmailer.php.
| PHPMailer::$SMTPKeepAlive = false |
Definiert in Zeile 238 der Datei class.phpmailer.php.
| PHPMailer::$SMTPSecure = '' |
Definiert in Zeile 199 der Datei class.phpmailer.php.
| PHPMailer::$Subject = '' |
Definiert in Zeile 103 der Datei class.phpmailer.php.
| PHPMailer::$Timeout = 10 |
Definiert in Zeile 224 der Datei class.phpmailer.php.
| PHPMailer::$Username = '' |
Definiert in Zeile 211 der Datei class.phpmailer.php.
| PHPMailer::$Version = '5.0.2' |
Definiert in Zeile 257 der Datei class.phpmailer.php.
| PHPMailer::$WordWrap = 0 |
Definiert in Zeile 126 der Datei class.phpmailer.php.
| const PHPMailer::STOP_CONTINUE = 1 |
Definiert in Zeile 285 der Datei class.phpmailer.php.
| const PHPMailer::STOP_CRITICAL = 2 |
Definiert in Zeile 286 der Datei class.phpmailer.php.
| const PHPMailer::STOP_MESSAGE = 0 |
Definiert in Zeile 284 der Datei class.phpmailer.php.
| Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|