Revision 1374
Added by Luisehahne almost 15 years ago
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 11 | 11 |
! = Update/Change |
| 12 | 12 |
|
| 13 | 13 |
------------------------------------- 2.8.2 ------------------------------------- |
| 14 |
10 Jan-2011 Build 1372 Dietmar Woellbrink (Luisehahne) |
|
| 14 |
10 Jan-2011 Build 1374 Dietmar Woellbrink (Luisehahne) |
|
| 15 |
# fixed headerinfos |
|
| 16 |
10 Jan-2011 Build 1373 Dietmar Woellbrink (Luisehahne) |
|
| 15 | 17 |
! update headerinfos |
| 16 | 18 |
10 Jan-2011 Build 1372 Dietmar Woellbrink (Luisehahne) |
| 17 | 19 |
# fixed class.wb.php to add class SecureForm |
| branches/2.8.x/wb/upgrade-script.php | ||
|---|---|---|
| 9 | 9 |
* @link http://www.websitebaker2.org/ |
| 10 | 10 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 11 |
* @platform WebsiteBaker 2.8.x |
| 12 |
* * @requirements PHP 5.2.2 and higher
|
|
| 12 |
* @requirements PHP 5.2.2 and higher |
|
| 13 | 13 |
* @version $Id$ |
| 14 | 14 |
* @filesource $HeadURL$ |
| 15 | 15 |
* @lastmodified $Date$ |
| branches/2.8.x/wb/include/phpmailer/class.phpmailer.php | ||
|---|---|---|
| 46 | 46 |
|
| 47 | 47 |
/** |
| 48 | 48 |
* Email priority (1 = High, 3 = Normal, 5 = low). |
| 49 |
* @var int
|
|
| 49 |
* @var int |
|
| 50 | 50 |
*/ |
| 51 | 51 |
var $Priority = 3; |
| 52 | 52 |
|
| 53 | 53 |
/** |
| 54 | 54 |
* Sets the CharSet of the message. |
| 55 |
* @var string
|
|
| 55 |
* @var string |
|
| 56 | 56 |
*/ |
| 57 | 57 |
var $CharSet = 'iso-8859-1'; |
| 58 | 58 |
|
| 59 | 59 |
/** |
| 60 | 60 |
* Sets the Content-type of the message. |
| 61 |
* @var string
|
|
| 61 |
* @var string |
|
| 62 | 62 |
*/ |
| 63 | 63 |
var $ContentType = 'text/plain'; |
| 64 | 64 |
|
| 65 | 65 |
/** |
| 66 | 66 |
* Sets the Encoding of the message. Options for this are "8bit", |
| 67 | 67 |
* "7bit", "binary", "base64", and "quoted-printable". |
| 68 |
* @var string
|
|
| 68 |
* @var string |
|
| 69 | 69 |
*/ |
| 70 | 70 |
var $Encoding = '8bit'; |
| 71 | 71 |
|
| 72 | 72 |
/** |
| 73 | 73 |
* Holds the most recent mailer error message. |
| 74 |
* @var string
|
|
| 74 |
* @var string |
|
| 75 | 75 |
*/ |
| 76 | 76 |
var $ErrorInfo = ''; |
| 77 | 77 |
|
| 78 | 78 |
/** |
| 79 | 79 |
* Sets the From email address for the message. |
| 80 |
* @var string
|
|
| 80 |
* @var string |
|
| 81 | 81 |
*/ |
| 82 | 82 |
var $From = 'root@localhost'; |
| 83 | 83 |
|
| 84 | 84 |
/** |
| 85 | 85 |
* Sets the From name of the message. |
| 86 |
* @var string
|
|
| 86 |
* @var string |
|
| 87 | 87 |
*/ |
| 88 | 88 |
var $FromName = 'Root User'; |
| 89 | 89 |
|
| 90 | 90 |
/** |
| 91 | 91 |
* Sets the Sender email (Return-Path) of the message. If not empty, |
| 92 | 92 |
* will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. |
| 93 |
* @var string
|
|
| 93 |
* @var string |
|
| 94 | 94 |
*/ |
| 95 | 95 |
var $Sender = ''; |
| 96 | 96 |
|
| 97 | 97 |
/** |
| 98 | 98 |
* Sets the Subject of the message. |
| 99 |
* @var string
|
|
| 99 |
* @var string |
|
| 100 | 100 |
*/ |
| 101 | 101 |
var $Subject = ''; |
| 102 | 102 |
|
| 103 | 103 |
/** |
| 104 | 104 |
* Sets the Body of the message. This can be either an HTML or text body. |
| 105 | 105 |
* If HTML then run IsHTML(true). |
| 106 |
* @var string
|
|
| 106 |
* @var string |
|
| 107 | 107 |
*/ |
| 108 | 108 |
var $Body = ''; |
| 109 | 109 |
|
| ... | ... | |
| 112 | 112 |
* email to multipart/alternative. This body can be read by mail |
| 113 | 113 |
* clients that do not have HTML email capability such as mutt. Clients |
| 114 | 114 |
* that can read HTML will view the normal Body. |
| 115 |
* @var string
|
|
| 115 |
* @var string |
|
| 116 | 116 |
*/ |
| 117 | 117 |
var $AltBody = ''; |
| 118 | 118 |
|
| 119 | 119 |
/** |
| 120 | 120 |
* Sets word wrapping on the body of the message to a given number of |
| 121 | 121 |
* characters. |
| 122 |
* @var int
|
|
| 122 |
* @var int |
|
| 123 | 123 |
*/ |
| 124 | 124 |
var $WordWrap = 0; |
| 125 | 125 |
|
| 126 | 126 |
/** |
| 127 | 127 |
* Method to send mail: ("mail", "sendmail", or "smtp").
|
| 128 |
* @var string
|
|
| 128 |
* @var string |
|
| 129 | 129 |
*/ |
| 130 | 130 |
var $Mailer = 'mail'; |
| 131 | 131 |
|
| 132 | 132 |
/** |
| 133 | 133 |
* Sets the path of the sendmail program. |
| 134 |
* @var string
|
|
| 134 |
* @var string |
|
| 135 | 135 |
*/ |
| 136 | 136 |
var $Sendmail = '/usr/sbin/sendmail'; |
| 137 | 137 |
|
| 138 | 138 |
/** |
| 139 | 139 |
* Path to PHPMailer plugins. This is now only useful if the SMTP class |
| 140 | 140 |
* is in a different directory than the PHP include path. |
| 141 |
* @var string
|
|
| 141 |
* @var string |
|
| 142 | 142 |
*/ |
| 143 | 143 |
var $PluginDir = ''; |
| 144 | 144 |
|
| 145 | 145 |
/** |
| 146 | 146 |
* Holds PHPMailer version. |
| 147 |
* @var string
|
|
| 147 |
* @var string |
|
| 148 | 148 |
*/ |
| 149 | 149 |
var $Version = "2.0.4"; |
| 150 | 150 |
|
| 151 | 151 |
/** |
| 152 | 152 |
* Sets the email address that a reading confirmation will be sent. |
| 153 |
* @var string
|
|
| 153 |
* @var string |
|
| 154 | 154 |
*/ |
| 155 | 155 |
var $ConfirmReadingTo = ''; |
| 156 | 156 |
|
| ... | ... | |
| 158 | 158 |
* Sets the hostname to use in Message-Id and Received headers |
| 159 | 159 |
* and as default HELO string. If empty, the value returned |
| 160 | 160 |
* by SERVER_NAME is used or 'localhost.localdomain'. |
| 161 |
* @var string
|
|
| 161 |
* @var string |
|
| 162 | 162 |
*/ |
| 163 | 163 |
var $Hostname = ''; |
| 164 | 164 |
|
| 165 | 165 |
/** |
| 166 | 166 |
* Sets the message ID to be used in the Message-Id header. |
| 167 | 167 |
* If empty, a unique id will be generated. |
| 168 |
* @var string
|
|
| 168 |
* @var string |
|
| 169 | 169 |
*/ |
| 170 | 170 |
var $MessageID = ''; |
| 171 | 171 |
|
| ... | ... | |
| 179 | 179 |
* for each host by using this format: [hostname:port] |
| 180 | 180 |
* (e.g. "smtp1.example.com:25;smtp2.example.com"). |
| 181 | 181 |
* Hosts will be tried in order. |
| 182 |
* @var string
|
|
| 182 |
* @var string |
|
| 183 | 183 |
*/ |
| 184 | 184 |
var $Host = 'localhost'; |
| 185 | 185 |
|
| 186 | 186 |
/** |
| 187 | 187 |
* Sets the default SMTP server port. |
| 188 |
* @var int
|
|
| 188 |
* @var int |
|
| 189 | 189 |
*/ |
| 190 | 190 |
var $Port = 25; |
| 191 | 191 |
|
| 192 | 192 |
/** |
| 193 | 193 |
* Sets the SMTP HELO of the message (Default is $Hostname). |
| 194 |
* @var string
|
|
| 194 |
* @var string |
|
| 195 | 195 |
*/ |
| 196 | 196 |
var $Helo = ''; |
| 197 | 197 |
|
| 198 | 198 |
/** |
| 199 | 199 |
* Sets connection prefix. |
| 200 | 200 |
* Options are "", "ssl" or "tls" |
| 201 |
* @var string
|
|
| 201 |
* @var string |
|
| 202 | 202 |
*/ |
| 203 | 203 |
var $SMTPSecure = ""; |
| 204 | 204 |
|
| 205 | 205 |
/** |
| 206 | 206 |
* Sets SMTP authentication. Utilizes the Username and Password variables. |
| 207 |
* @var bool
|
|
| 207 |
* @var bool |
|
| 208 | 208 |
*/ |
| 209 | 209 |
var $SMTPAuth = false; |
| 210 | 210 |
|
| 211 | 211 |
/** |
| 212 | 212 |
* Sets SMTP username. |
| 213 |
* @var string
|
|
| 213 |
* @var string |
|
| 214 | 214 |
*/ |
| 215 | 215 |
var $Username = ''; |
| 216 | 216 |
|
| 217 | 217 |
/** |
| 218 | 218 |
* Sets SMTP password. |
| 219 |
* @var string
|
|
| 219 |
* @var string |
|
| 220 | 220 |
*/ |
| 221 | 221 |
var $Password = ''; |
| 222 | 222 |
|
| 223 | 223 |
/** |
| 224 | 224 |
* Sets the SMTP server timeout in seconds. This function will not |
| 225 | 225 |
* work with the win32 version. |
| 226 |
* @var int
|
|
| 226 |
* @var int |
|
| 227 | 227 |
*/ |
| 228 | 228 |
var $Timeout = 10; |
| 229 | 229 |
|
| 230 | 230 |
/** |
| 231 | 231 |
* Sets SMTP class debugging on or off. |
| 232 |
* @var bool
|
|
| 232 |
* @var bool |
|
| 233 | 233 |
*/ |
| 234 | 234 |
var $SMTPDebug = false; |
| 235 | 235 |
|
| ... | ... | |
| 237 | 237 |
* Prevents the SMTP connection from being closed after each mail |
| 238 | 238 |
* sending. If this is set to true then to close the connection |
| 239 | 239 |
* requires an explicit call to SmtpClose(). |
| 240 |
* @var bool
|
|
| 240 |
* @var bool |
|
| 241 | 241 |
*/ |
| 242 | 242 |
var $SMTPKeepAlive = false; |
| 243 | 243 |
|
| 244 | 244 |
/** |
| 245 | 245 |
* Provides the ability to have the TO field process individual |
| 246 | 246 |
* emails, instead of sending to entire TO addresses |
| 247 |
* @var bool
|
|
| 247 |
* @var bool |
|
| 248 | 248 |
*/ |
| 249 | 249 |
var $SingleTo = false; |
| 250 | 250 |
|
| ... | ... | |
| 274 | 274 |
|
| 275 | 275 |
/** |
| 276 | 276 |
* Sets message type to HTML. |
| 277 |
* @param bool $bool
|
|
| 278 |
* @return void
|
|
| 277 |
* @param bool $bool |
|
| 278 |
* @return void |
|
| 279 | 279 |
*/ |
| 280 | 280 |
function IsHTML($bool) {
|
| 281 | 281 |
if($bool == true) {
|
| ... | ... | |
| 287 | 287 |
|
| 288 | 288 |
/** |
| 289 | 289 |
* Sets Mailer to send message using SMTP. |
| 290 |
* @return void
|
|
| 290 |
* @return void |
|
| 291 | 291 |
*/ |
| 292 | 292 |
function IsSMTP() {
|
| 293 | 293 |
$this->Mailer = 'smtp'; |
| ... | ... | |
| 295 | 295 |
|
| 296 | 296 |
/** |
| 297 | 297 |
* Sets Mailer to send message using PHP mail() function. |
| 298 |
* @return void
|
|
| 298 |
* @return void |
|
| 299 | 299 |
*/ |
| 300 | 300 |
function IsMail() {
|
| 301 | 301 |
$this->Mailer = 'mail'; |
| ... | ... | |
| 303 | 303 |
|
| 304 | 304 |
/** |
| 305 | 305 |
* Sets Mailer to send message using the $Sendmail program. |
| 306 |
* @return void
|
|
| 306 |
* @return void |
|
| 307 | 307 |
*/ |
| 308 | 308 |
function IsSendmail() {
|
| 309 | 309 |
$this->Mailer = 'sendmail'; |
| ... | ... | |
| 311 | 311 |
|
| 312 | 312 |
/** |
| 313 | 313 |
* Sets Mailer to send message using the qmail MTA. |
| 314 |
* @return void
|
|
| 314 |
* @return void |
|
| 315 | 315 |
*/ |
| 316 | 316 |
function IsQmail() {
|
| 317 | 317 |
$this->Sendmail = '/var/qmail/bin/sendmail'; |
| ... | ... | |
| 324 | 324 |
|
| 325 | 325 |
/** |
| 326 | 326 |
* Adds a "To" address. |
| 327 |
* @param string $address
|
|
| 328 |
* @param string $name
|
|
| 329 |
* @return void
|
|
| 327 |
* @param string $address |
|
| 328 |
* @param string $name |
|
| 329 |
* @return void |
|
| 330 | 330 |
*/ |
| 331 | 331 |
function AddAddress($address, $name = '') {
|
| 332 | 332 |
$cur = count($this->to); |
| ... | ... | |
| 338 | 338 |
* Adds a "Cc" address. Note: this function works |
| 339 | 339 |
* with the SMTP mailer on win32, not with the "mail" |
| 340 | 340 |
* mailer. |
| 341 |
* @param string $address
|
|
| 342 |
* @param string $name
|
|
| 343 |
* @return void
|
|
| 341 |
* @param string $address |
|
| 342 |
* @param string $name |
|
| 343 |
* @return void |
|
| 344 | 344 |
*/ |
| 345 | 345 |
function AddCC($address, $name = '') {
|
| 346 | 346 |
$cur = count($this->cc); |
| ... | ... | |
| 352 | 352 |
* Adds a "Bcc" address. Note: this function works |
| 353 | 353 |
* with the SMTP mailer on win32, not with the "mail" |
| 354 | 354 |
* mailer. |
| 355 |
* @param string $address
|
|
| 356 |
* @param string $name
|
|
| 357 |
* @return void
|
|
| 355 |
* @param string $address |
|
| 356 |
* @param string $name |
|
| 357 |
* @return void |
|
| 358 | 358 |
*/ |
| 359 | 359 |
function AddBCC($address, $name = '') {
|
| 360 | 360 |
$cur = count($this->bcc); |
| ... | ... | |
| 364 | 364 |
|
| 365 | 365 |
/** |
| 366 | 366 |
* Adds a "Reply-To" address. |
| 367 |
* @param string $address
|
|
| 368 |
* @param string $name
|
|
| 369 |
* @return void
|
|
| 367 |
* @param string $address |
|
| 368 |
* @param string $name |
|
| 369 |
* @return void |
|
| 370 | 370 |
*/ |
| 371 | 371 |
function AddReplyTo($address, $name = '') {
|
| 372 | 372 |
$cur = count($this->ReplyTo); |
| ... | ... | |
| 382 | 382 |
* Creates message and assigns Mailer. If the message is |
| 383 | 383 |
* not sent successfully then it returns false. Use the ErrorInfo |
| 384 | 384 |
* variable to view description of the error. |
| 385 |
* @return bool
|
|
| 385 |
* @return bool |
|
| 386 | 386 |
*/ |
| 387 | 387 |
function Send() {
|
| 388 | 388 |
$header = ''; |
| ... | ... | |
| 432 | 432 |
|
| 433 | 433 |
/** |
| 434 | 434 |
* Sends mail using the $Sendmail program. |
| 435 |
* @access private
|
|
| 436 |
* @return bool
|
|
| 435 |
* @access private |
|
| 436 |
* @return bool |
|
| 437 | 437 |
*/ |
| 438 | 438 |
function SendmailSend($header, $body) {
|
| 439 | 439 |
if ($this->Sender != '') {
|
| ... | ... | |
| 463 | 463 |
|
| 464 | 464 |
/** |
| 465 | 465 |
* Sends mail using the PHP mail() function. |
| 466 |
* @access private
|
|
| 467 |
* @return bool
|
|
| 466 |
* @access private |
|
| 467 |
* @return bool |
|
| 468 | 468 |
*/ |
| 469 | 469 |
function MailSend($header, $body) {
|
| 470 | 470 |
|
| ... | ... | |
| 513 | 513 |
* Sends mail via SMTP using PhpSMTP (Author: |
| 514 | 514 |
* Chris Ryan). Returns bool. Returns false if there is a |
| 515 | 515 |
* bad MAIL FROM, RCPT, or DATA input. |
| 516 |
* @access private
|
|
| 517 |
* @return bool
|
|
| 516 |
* @access private |
|
| 517 |
* @return bool |
|
| 518 | 518 |
*/ |
| 519 | 519 |
function SmtpSend($header, $body) {
|
| 520 | 520 |
include_once($this->PluginDir . 'class.smtp.php'); |
| ... | ... | |
| 580 | 580 |
/** |
| 581 | 581 |
* Initiates a connection to an SMTP server. Returns false if the |
| 582 | 582 |
* operation failed. |
| 583 |
* @access private
|
|
| 584 |
* @return bool
|
|
| 583 |
* @access private |
|
| 584 |
* @return bool |
|
| 585 | 585 |
*/ |
| 586 | 586 |
function SmtpConnect() |
| 587 | 587 |
{
|
| ... | ... | |
| 635 | 635 |
|
| 636 | 636 |
/** |
| 637 | 637 |
* Closes the active SMTP session if one exists. |
| 638 |
* @return void
|
|
| 638 |
* @return void |
|
| 639 | 639 |
*/ |
| 640 | 640 |
function SmtpClose() {
|
| 641 | 641 |
if($this->smtp != NULL) {
|
| ... | ... | |
| 650 | 650 |
* Sets the language for all class error messages. Returns false |
| 651 | 651 |
* if it cannot load the language file. The default language type |
| 652 | 652 |
* is English. |
| 653 |
* @param string $lang_type Type of language (e.g. Portuguese: "br")
|
|
| 654 |
* @param string $lang_path Path to the language file directory
|
|
| 655 |
* @access public
|
|
| 656 |
* @return bool
|
|
| 653 |
* @param string $lang_type Type of language (e.g. Portuguese: "br") |
|
| 654 |
* @param string $lang_path Path to the language file directory |
|
| 655 |
* @access public |
|
| 656 |
* @return bool |
|
| 657 | 657 |
*/ |
| 658 | 658 |
function SetLanguage($lang_type, $lang_path = 'language/') {
|
| 659 | 659 |
if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
|
| ... | ... | |
| 687 | 687 |
|
| 688 | 688 |
/** |
| 689 | 689 |
* Creates recipient headers. |
| 690 |
* @access private
|
|
| 691 |
* @return string
|
|
| 690 |
* @access private |
|
| 691 |
* @return string |
|
| 692 | 692 |
*/ |
| 693 | 693 |
function AddrAppend($type, $addr) {
|
| 694 | 694 |
$addr_str = $type . ': '; |
| ... | ... | |
| 705 | 705 |
|
| 706 | 706 |
/** |
| 707 | 707 |
* Formats an address correctly. |
| 708 |
* @access private
|
|
| 709 |
* @return string
|
|
| 708 |
* @access private |
|
| 709 |
* @return string |
|
| 710 | 710 |
*/ |
| 711 | 711 |
function AddrFormat($addr) {
|
| 712 | 712 |
if(empty($addr[1])) {
|
| ... | ... | |
| 722 | 722 |
* Wraps message for use with mailers that do not |
| 723 | 723 |
* automatically perform wrapping and for quoted-printable. |
| 724 | 724 |
* Original written by philippe. |
| 725 |
* @access private
|
|
| 726 |
* @return string
|
|
| 725 |
* @access private |
|
| 726 |
* @return string |
|
| 727 | 727 |
*/ |
| 728 | 728 |
function WrapText($message, $length, $qp_mode = false) {
|
| 729 | 729 |
$soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
|
| ... | ... | |
| 802 | 802 |
* Finds last character boundary prior to maxLength in a utf-8 |
| 803 | 803 |
* quoted (printable) encoded string. |
| 804 | 804 |
* Original written by Colin Brown. |
| 805 |
* @access private
|
|
| 806 |
* @param string $encodedText utf-8 QP text
|
|
| 807 |
* @param int $maxLength find last character boundary prior to this length
|
|
| 808 |
* @return int
|
|
| 805 |
* @access private |
|
| 806 |
* @param string $encodedText utf-8 QP text |
|
| 807 |
* @param int $maxLength find last character boundary prior to this length |
|
| 808 |
* @return int |
|
| 809 | 809 |
*/ |
| 810 | 810 |
function UTF8CharBoundary($encodedText, $maxLength) {
|
| 811 | 811 |
$foundSplitPos = false; |
| ... | ... | |
| 841 | 841 |
|
| 842 | 842 |
/** |
| 843 | 843 |
* Set the body wrapping. |
| 844 |
* @access private
|
|
| 845 |
* @return void
|
|
| 844 |
* @access private |
|
| 845 |
* @return void |
|
| 846 | 846 |
*/ |
| 847 | 847 |
function SetWordWrap() {
|
| 848 | 848 |
if($this->WordWrap < 1) {
|
| ... | ... | |
| 863 | 863 |
|
| 864 | 864 |
/** |
| 865 | 865 |
* Assembles message header. |
| 866 |
* @access private
|
|
| 867 |
* @return string
|
|
| 866 |
* @access private |
|
| 867 |
* @return string |
|
| 868 | 868 |
*/ |
| 869 | 869 |
function CreateHeader() {
|
| 870 | 870 |
$result = ''; |
| ... | ... | |
| 940 | 940 |
|
| 941 | 941 |
/** |
| 942 | 942 |
* Returns the message MIME. |
| 943 |
* @access private
|
|
| 944 |
* @return string
|
|
| 943 |
* @access private |
|
| 944 |
* @return string |
|
| 945 | 945 |
*/ |
| 946 | 946 |
function GetMailMIME() {
|
| 947 | 947 |
$result = ''; |
| ... | ... | |
| 975 | 975 |
|
| 976 | 976 |
/** |
| 977 | 977 |
* Assembles the message body. Returns an empty string on failure. |
| 978 |
* @access private
|
|
| 979 |
* @return string
|
|
| 978 |
* @access private |
|
| 979 |
* @return string |
|
| 980 | 980 |
*/ |
| 981 | 981 |
function CreateBody() {
|
| 982 | 982 |
$result = ''; |
| ... | ... | |
| 1050 | 1050 |
|
| 1051 | 1051 |
/** |
| 1052 | 1052 |
* Returns the start of a message boundary. |
| 1053 |
* @access private
|
|
| 1053 |
* @access private |
|
| 1054 | 1054 |
*/ |
| 1055 | 1055 |
function GetBoundary($boundary, $charSet, $contentType, $encoding) {
|
| 1056 | 1056 |
$result = ''; |
| ... | ... | |
| 1074 | 1074 |
|
| 1075 | 1075 |
/** |
| 1076 | 1076 |
* Returns the end of a message boundary. |
| 1077 |
* @access private
|
|
| 1077 |
* @access private |
|
| 1078 | 1078 |
*/ |
| 1079 | 1079 |
function EndBoundary($boundary) {
|
| 1080 | 1080 |
return $this->LE . '--' . $boundary . '--' . $this->LE; |
| ... | ... | |
| 1082 | 1082 |
|
| 1083 | 1083 |
/** |
| 1084 | 1084 |
* Sets the message type. |
| 1085 |
* @access private
|
|
| 1086 |
* @return void
|
|
| 1085 |
* @access private |
|
| 1086 |
* @return void |
|
| 1087 | 1087 |
*/ |
| 1088 | 1088 |
function SetMessageType() {
|
| 1089 | 1089 |
if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
|
| ... | ... | |
| 1102 | 1102 |
} |
| 1103 | 1103 |
|
| 1104 | 1104 |
/* Returns a formatted header line. |
| 1105 |
* @access private
|
|
| 1106 |
* @return string
|
|
| 1105 |
* @access private |
|
| 1106 |
* @return string |
|
| 1107 | 1107 |
*/ |
| 1108 | 1108 |
function HeaderLine($name, $value) {
|
| 1109 | 1109 |
return $name . ': ' . $value . $this->LE; |
| ... | ... | |
| 1111 | 1111 |
|
| 1112 | 1112 |
/** |
| 1113 | 1113 |
* Returns a formatted mail line. |
| 1114 |
* @access private
|
|
| 1115 |
* @return string
|
|
| 1114 |
* @access private |
|
| 1115 |
* @return string |
|
| 1116 | 1116 |
*/ |
| 1117 | 1117 |
function TextLine($value) {
|
| 1118 | 1118 |
return $value . $this->LE; |
| ... | ... | |
| 1126 | 1126 |
* Adds an attachment from a path on the filesystem. |
| 1127 | 1127 |
* Returns false if the file could not be found |
| 1128 | 1128 |
* or accessed. |
| 1129 |
* @param string $path Path to the attachment.
|
|
| 1130 |
* @param string $name Overrides the attachment name.
|
|
| 1131 |
* @param string $encoding File encoding (see $Encoding).
|
|
| 1132 |
* @param string $type File extension (MIME) type.
|
|
| 1133 |
* @return bool
|
|
| 1129 |
* @param string $path Path to the attachment. |
|
| 1130 |
* @param string $name Overrides the attachment name. |
|
| 1131 |
* @param string $encoding File encoding (see $Encoding). |
|
| 1132 |
* @param string $type File extension (MIME) type. |
|
| 1133 |
* @return bool |
|
| 1134 | 1134 |
*/ |
| 1135 | 1135 |
function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
|
| 1136 | 1136 |
if(!@is_file($path)) {
|
| ... | ... | |
| 1159 | 1159 |
/** |
| 1160 | 1160 |
* Attaches all fs, string, and binary attachments to the message. |
| 1161 | 1161 |
* Returns an empty string on failure. |
| 1162 |
* @access private
|
|
| 1163 |
* @return string
|
|
| 1162 |
* @access private |
|
| 1163 |
* @return string |
|
| 1164 | 1164 |
*/ |
| 1165 | 1165 |
function AttachAll() {
|
| 1166 | 1166 |
/* Return text of body */ |
| ... | ... | |
| 1217 | 1217 |
/** |
| 1218 | 1218 |
* Encodes attachment in requested format. Returns an |
| 1219 | 1219 |
* empty string on failure. |
| 1220 |
* @access private
|
|
| 1221 |
* @return string
|
|
| 1220 |
* @access private |
|
| 1221 |
* @return string |
|
| 1222 | 1222 |
*/ |
| 1223 | 1223 |
function EncodeFile ($path, $encoding = 'base64') {
|
| 1224 | 1224 |
if(!@$fd = fopen($path, 'rb')) {
|
| ... | ... | |
| 1247 | 1247 |
/** |
| 1248 | 1248 |
* Encodes string to requested format. Returns an |
| 1249 | 1249 |
* empty string on failure. |
| 1250 |
* @access private
|
|
| 1251 |
* @return string
|
|
| 1250 |
* @access private |
|
| 1251 |
* @return string |
|
| 1252 | 1252 |
*/ |
| 1253 | 1253 |
function EncodeString ($str, $encoding = 'base64') {
|
| 1254 | 1254 |
$encoded = ''; |
| ... | ... | |
| 1278 | 1278 |
|
| 1279 | 1279 |
/** |
| 1280 | 1280 |
* Encode a header string to best of Q, B, quoted or none. |
| 1281 |
* @access private
|
|
| 1282 |
* @return string
|
|
| 1281 |
* @access private |
|
| 1282 |
* @return string |
|
| 1283 | 1283 |
*/ |
| 1284 | 1284 |
function EncodeHeader ($str, $position = 'text') {
|
| 1285 | 1285 |
$x = 0; |
| ... | ... | |
| 1338 | 1338 |
|
| 1339 | 1339 |
/** |
| 1340 | 1340 |
* Checks if a string contains multibyte characters. |
| 1341 |
* @access private
|
|
| 1342 |
* @param string $str multi-byte text to wrap encode
|
|
| 1343 |
* @return bool
|
|
| 1341 |
* @access private |
|
| 1342 |
* @param string $str multi-byte text to wrap encode |
|
| 1343 |
* @return bool |
|
| 1344 | 1344 |
*/ |
| 1345 | 1345 |
function HasMultiBytes($str) {
|
| 1346 | 1346 |
if (function_exists('mb_strlen')) {
|
| ... | ... | |
| 1354 | 1354 |
* Correctly encodes and wraps long multibyte strings for mail headers |
| 1355 | 1355 |
* without breaking lines within a character. |
| 1356 | 1356 |
* Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php |
| 1357 |
* @access private
|
|
| 1358 |
* @param string $str multi-byte text to wrap encode
|
|
| 1359 |
* @return string
|
|
| 1357 |
* @access private |
|
| 1358 |
* @param string $str multi-byte text to wrap encode |
|
| 1359 |
* @return string |
|
| 1360 | 1360 |
*/ |
| 1361 | 1361 |
function Base64EncodeWrapMB($str) {
|
| 1362 | 1362 |
$start = "=?".$this->CharSet."?B?"; |
| ... | ... | |
| 1392 | 1392 |
|
| 1393 | 1393 |
/** |
| 1394 | 1394 |
* Encode string to quoted-printable. |
| 1395 |
* @access private
|
|
| 1396 |
* @return string
|
|
| 1395 |
* @access private |
|
| 1396 |
* @return string |
|
| 1397 | 1397 |
*/ |
| 1398 | 1398 |
function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
|
| 1399 | 1399 |
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
|
| ... | ... | |
| 1438 | 1438 |
|
| 1439 | 1439 |
/** |
| 1440 | 1440 |
* Encode string to q encoding. |
| 1441 |
* @access private
|
|
| 1442 |
* @return string
|
|
| 1441 |
* @access private |
|
| 1442 |
* @return string |
|
| 1443 | 1443 |
*/ |
| 1444 | 1444 |
function EncodeQ ($str, $position = 'text') {
|
| 1445 | 1445 |
/* There should not be any EOL in the string */ |
| ... | ... | |
| 1469 | 1469 |
* Adds a string or binary attachment (non-filesystem) to the list. |
| 1470 | 1470 |
* This method can be used to attach ascii or binary data, |
| 1471 | 1471 |
* such as a BLOB record from a database. |
| 1472 |
* @param string $string String attachment data.
|
|
| 1473 |
* @param string $filename Name of the attachment.
|
|
| 1474 |
* @param string $encoding File encoding (see $Encoding).
|
|
| 1475 |
* @param string $type File extension (MIME) type.
|
|
| 1476 |
* @return void
|
|
| 1472 |
* @param string $string String attachment data. |
|
| 1473 |
* @param string $filename Name of the attachment. |
|
| 1474 |
* @param string $encoding File encoding (see $Encoding). |
|
| 1475 |
* @param string $type File extension (MIME) type. |
|
| 1476 |
* @return void |
|
| 1477 | 1477 |
*/ |
| 1478 | 1478 |
function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
|
| 1479 | 1479 |
/* Append to $attachment array */ |
| ... | ... | |
| 1493 | 1493 |
* just about any other document. Make sure to set the $type to an |
| 1494 | 1494 |
* image type. For JPEG images use "image/jpeg" and for GIF images |
| 1495 | 1495 |
* use "image/gif". |
| 1496 |
* @param string $path Path to the attachment.
|
|
| 1497 |
* @param string $cid Content ID of the attachment. Use this to identify
|
|
| 1496 |
* @param string $path Path to the attachment. |
|
| 1497 |
* @param string $cid Content ID of the attachment. Use this to identify |
|
| 1498 | 1498 |
* the Id for accessing the image in an HTML form. |
| 1499 |
* @param string $name Overrides the attachment name.
|
|
| 1500 |
* @param string $encoding File encoding (see $Encoding).
|
|
| 1501 |
* @param string $type File extension (MIME) type.
|
|
| 1502 |
* @return bool
|
|
| 1499 |
* @param string $name Overrides the attachment name. |
|
| 1500 |
* @param string $encoding File encoding (see $Encoding). |
|
| 1501 |
* @param string $type File extension (MIME) type. |
|
| 1502 |
* @return bool |
|
| 1503 | 1503 |
*/ |
| 1504 | 1504 |
function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
|
| 1505 | 1505 |
|
| ... | ... | |
| 1529 | 1529 |
|
| 1530 | 1530 |
/** |
| 1531 | 1531 |
* Returns true if an inline attachment is present. |
| 1532 |
* @access private
|
|
| 1533 |
* @return bool
|
|
| 1532 |
* @access private |
|
| 1533 |
* @return bool |
|
| 1534 | 1534 |
*/ |
| 1535 | 1535 |
function InlineImageExists() {
|
| 1536 | 1536 |
$result = false; |
| ... | ... | |
| 1550 | 1550 |
|
| 1551 | 1551 |
/** |
| 1552 | 1552 |
* Clears all recipients assigned in the TO array. Returns void. |
| 1553 |
* @return void
|
|
| 1553 |
* @return void |
|
| 1554 | 1554 |
*/ |
| 1555 | 1555 |
function ClearAddresses() {
|
| 1556 | 1556 |
$this->to = array(); |
| ... | ... | |
| 1558 | 1558 |
|
| 1559 | 1559 |
/** |
| 1560 | 1560 |
* Clears all recipients assigned in the CC array. Returns void. |
| 1561 |
* @return void
|
|
| 1561 |
* @return void |
|
| 1562 | 1562 |
*/ |
| 1563 | 1563 |
function ClearCCs() {
|
| 1564 | 1564 |
$this->cc = array(); |
| ... | ... | |
| 1566 | 1566 |
|
| 1567 | 1567 |
/** |
| 1568 | 1568 |
* Clears all recipients assigned in the BCC array. Returns void. |
| 1569 |
* @return void
|
|
| 1569 |
* @return void |
|
| 1570 | 1570 |
*/ |
| 1571 | 1571 |
function ClearBCCs() {
|
| 1572 | 1572 |
$this->bcc = array(); |
| ... | ... | |
| 1574 | 1574 |
|
| 1575 | 1575 |
/** |
| 1576 | 1576 |
* Clears all recipients assigned in the ReplyTo array. Returns void. |
| 1577 |
* @return void
|
|
| 1577 |
* @return void |
|
| 1578 | 1578 |
*/ |
| 1579 | 1579 |
function ClearReplyTos() {
|
| 1580 | 1580 |
$this->ReplyTo = array(); |
| ... | ... | |
| 1583 | 1583 |
/** |
| 1584 | 1584 |
* Clears all recipients assigned in the TO, CC and BCC |
| 1585 | 1585 |
* array. Returns void. |
| 1586 |
* @return void
|
|
| 1586 |
* @return void |
|
| 1587 | 1587 |
*/ |
| 1588 | 1588 |
function ClearAllRecipients() {
|
| 1589 | 1589 |
$this->to = array(); |
| ... | ... | |
| 1594 | 1594 |
/** |
| 1595 | 1595 |
* Clears all previously set filesystem, string, and binary |
| 1596 | 1596 |
* attachments. Returns void. |
| 1597 |
* @return void
|
|
| 1597 |
* @return void |
|
| 1598 | 1598 |
*/ |
| 1599 | 1599 |
function ClearAttachments() {
|
| 1600 | 1600 |
$this->attachment = array(); |
| ... | ... | |
| 1602 | 1602 |
|
| 1603 | 1603 |
/** |
| 1604 | 1604 |
* Clears all custom headers. Returns void. |
| 1605 |
* @return void
|
|
| 1605 |
* @return void |
|
| 1606 | 1606 |
*/ |
| 1607 | 1607 |
function ClearCustomHeaders() {
|
| 1608 | 1608 |
$this->CustomHeader = array(); |
| ... | ... | |
| 1615 | 1615 |
/** |
| 1616 | 1616 |
* Adds the error message to the error container. |
| 1617 | 1617 |
* Returns void. |
| 1618 |
* @access private
|
|
| 1619 |
* @return void
|
|
| 1618 |
* @access private |
|
| 1619 |
* @return void |
|
| 1620 | 1620 |
*/ |
| 1621 | 1621 |
function SetError($msg) {
|
| 1622 | 1622 |
$this->error_count++; |
| ... | ... | |
| 1625 | 1625 |
|
| 1626 | 1626 |
/** |
| 1627 | 1627 |
* Returns the proper RFC 822 formatted date. |
| 1628 |
* @access private
|
|
| 1629 |
* @return string
|
|
| 1628 |
* @access private |
|
| 1629 |
* @return string |
|
| 1630 | 1630 |
*/ |
| 1631 | 1631 |
function RFCDate() {
|
| 1632 | 1632 |
$tz = date('Z');
|
| ... | ... | |
| 1642 | 1642 |
* Returns the appropriate server variable. Should work with both |
| 1643 | 1643 |
* PHP 4.1.0+ as well as older versions. Returns an empty string |
| 1644 | 1644 |
* if nothing is found. |
| 1645 |
* @access private
|
|
| 1646 |
* @return mixed
|
|
| 1645 |
* @access private |
|
| 1646 |
* @return mixed |
|
| 1647 | 1647 |
*/ |
| 1648 | 1648 |
function ServerVar($varName) {
|
| 1649 | 1649 |
global $HTTP_SERVER_VARS; |
| ... | ... | |
| 1665 | 1665 |
|
| 1666 | 1666 |
/** |
| 1667 | 1667 |
* Returns the server hostname or 'localhost.localdomain' if unknown. |
| 1668 |
* @access private
|
|
| 1669 |
* @return string
|
|
| 1668 |
* @access private |
|
| 1669 |
* @return string |
|
| 1670 | 1670 |
*/ |
| 1671 | 1671 |
function ServerHostname() {
|
| 1672 | 1672 |
if ($this->Hostname != '') {
|
| ... | ... | |
| 1682 | 1682 |
|
| 1683 | 1683 |
/** |
| 1684 | 1684 |
* Returns a message in the appropriate language. |
| 1685 |
* @access private
|
|
| 1686 |
* @return string
|
|
| 1685 |
* @access private |
|
| 1686 |
* @return string |
|
| 1687 | 1687 |
*/ |
| 1688 | 1688 |
function Lang($key) {
|
| 1689 | 1689 |
if(count($this->language) < 1) {
|
| ... | ... | |
| 1699 | 1699 |
|
| 1700 | 1700 |
/** |
| 1701 | 1701 |
* Returns true if an error occurred. |
| 1702 |
* @return bool
|
|
| 1702 |
* @return bool |
|
| 1703 | 1703 |
*/ |
| 1704 | 1704 |
function IsError() {
|
| 1705 | 1705 |
return ($this->error_count > 0); |
| ... | ... | |
| 1707 | 1707 |
|
| 1708 | 1708 |
/** |
| 1709 | 1709 |
* Changes every end of line from CR or LF to CRLF. |
| 1710 |
* @access private
|
|
| 1711 |
* @return string
|
|
| 1710 |
* @access private |
|
| 1711 |
* @return string |
|
| 1712 | 1712 |
*/ |
| 1713 | 1713 |
function FixEOL($str) {
|
| 1714 | 1714 |
$str = str_replace("\r\n", "\n", $str);
|
| ... | ... | |
| 1719 | 1719 |
|
| 1720 | 1720 |
/** |
| 1721 | 1721 |
* Adds a custom header. |
| 1722 |
* @return void
|
|
| 1722 |
* @return void |
|
| 1723 | 1723 |
*/ |
| 1724 | 1724 |
function AddCustomHeader($custom_header) {
|
| 1725 | 1725 |
$this->CustomHeader[] = explode(':', $custom_header, 2);
|
| ... | ... | |
| 1727 | 1727 |
|
| 1728 | 1728 |
/** |
| 1729 | 1729 |
* Evaluates the message and returns modifications for inline images and backgrounds |
| 1730 |
* @access public
|
|
| 1731 |
* @return $message
|
|
| 1730 |
* @access public |
|
| 1731 |
* @return $message |
|
| 1732 | 1732 |
*/ |
| 1733 | 1733 |
function MsgHTML($message,$basedir='') {
|
| 1734 | 1734 |
preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
|
| ... | ... | |
| 1764 | 1764 |
|
| 1765 | 1765 |
/** |
| 1766 | 1766 |
* Gets the mime type of the embedded or inline image |
| 1767 |
* @access private
|
|
| 1768 |
* @return mime type of ext
|
|
| 1767 |
* @access private |
|
| 1768 |
* @return mime type of ext |
|
| 1769 | 1769 |
*/ |
| 1770 | 1770 |
function _mime_types($ext = '') {
|
| 1771 | 1771 |
$mimes = array( |
| ... | ... | |
| 1865 | 1865 |
* Usage Example: |
| 1866 | 1866 |
* $page->set('X-Priority', '3');
|
| 1867 | 1867 |
* |
| 1868 |
* @access public
|
|
| 1869 |
* @param string $name Parameter Name
|
|
| 1870 |
* @param mixed $value Parameter Value
|
|
| 1868 |
* @access public |
|
| 1869 |
* @param string $name Parameter Name |
|
| 1870 |
* @param mixed $value Parameter Value |
|
| 1871 | 1871 |
* NOTE: will not work with arrays, there are no arrays to set/reset |
| 1872 | 1872 |
*/ |
| 1873 | 1873 |
function set ( $name, $value = '' ) {
|
| ... | ... | |
| 1882 | 1882 |
/** |
| 1883 | 1883 |
* Read a file from a supplied filename and return it. |
| 1884 | 1884 |
* |
| 1885 |
* @access public
|
|
| 1886 |
* @param string $filename Parameter File Name
|
|
| 1885 |
* @access public |
|
| 1886 |
* @param string $filename Parameter File Name |
|
| 1887 | 1887 |
*/ |
| 1888 | 1888 |
function getFile($filename) {
|
| 1889 | 1889 |
$return = ''; |
| ... | ... | |
| 1900 | 1900 |
|
| 1901 | 1901 |
/** |
| 1902 | 1902 |
* Strips newlines to prevent header injection. |
| 1903 |
* @access private
|
|
| 1904 |
* @param string $str String
|
|
| 1905 |
* @return string
|
|
| 1903 |
* @access private |
|
| 1904 |
* @param string $str String |
|
| 1905 |
* @return string |
|
| 1906 | 1906 |
*/ |
| 1907 | 1907 |
function SecureHeader($str) {
|
| 1908 | 1908 |
$str = trim($str); |
| ... | ... | |
| 1914 | 1914 |
/** |
| 1915 | 1915 |
* Set the private key file and password to sign the message. |
| 1916 | 1916 |
* |
| 1917 |
* @access public
|
|
| 1918 |
* @param string $key_filename Parameter File Name
|
|
| 1919 |
* @param string $key_pass Password for private key
|
|
| 1917 |
* @access public |
|
| 1918 |
* @param string $key_filename Parameter File Name |
|
| 1919 |
* @param string $key_pass Password for private key |
|
| 1920 | 1920 |
*/ |
| 1921 | 1921 |
function Sign($cert_filename, $key_filename, $key_pass) {
|
| 1922 | 1922 |
$this->sign_cert_file = $cert_filename; |
| branches/2.8.x/wb/include/phpmailer/class.pop3.php | ||
|---|---|---|
| 47 | 47 |
{
|
| 48 | 48 |
/** |
| 49 | 49 |
* Default POP3 port |
| 50 |
* @var int
|
|
| 50 |
* @var int |
|
| 51 | 51 |
*/ |
| 52 | 52 |
var $POP3_PORT = 110; |
| 53 | 53 |
|
| 54 | 54 |
/** |
| 55 | 55 |
* Default Timeout |
| 56 |
* @var int
|
|
| 56 |
* @var int |
|
| 57 | 57 |
*/ |
| 58 | 58 |
var $POP3_TIMEOUT = 30; |
| 59 | 59 |
|
| 60 | 60 |
/** |
| 61 | 61 |
* POP3 Carriage Return + Line Feed |
| 62 |
* @var string
|
|
| 62 |
* @var string |
|
| 63 | 63 |
*/ |
| 64 | 64 |
var $CRLF = "\r\n"; |
| 65 | 65 |
|
| 66 | 66 |
/** |
| 67 | 67 |
* Displaying Debug warnings? (0 = now, 1+ = yes) |
| 68 |
* @var int
|
|
| 68 |
* @var int |
|
| 69 | 69 |
*/ |
| 70 | 70 |
var $do_debug = 2; |
| 71 | 71 |
|
| 72 | 72 |
/** |
| 73 | 73 |
* POP3 Mail Server |
| 74 |
* @var string
|
|
| 74 |
* @var string |
|
| 75 | 75 |
*/ |
| 76 | 76 |
var $host; |
| 77 | 77 |
|
| 78 | 78 |
/** |
| 79 | 79 |
* POP3 Port |
| 80 |
* @var int
|
|
| 80 |
* @var int |
|
| 81 | 81 |
*/ |
| 82 | 82 |
var $port; |
| 83 | 83 |
|
| 84 | 84 |
/** |
| 85 | 85 |
* POP3 Timeout Value |
| 86 |
* @var int
|
|
| 86 |
* @var int |
|
| 87 | 87 |
*/ |
| 88 | 88 |
var $tval; |
| 89 | 89 |
|
| 90 | 90 |
/** |
| 91 | 91 |
* POP3 Username |
| 92 |
* @var string
|
|
| 92 |
* @var string |
|
| 93 | 93 |
*/ |
| 94 | 94 |
var $username; |
| 95 | 95 |
|
| 96 | 96 |
/** |
| 97 | 97 |
* POP3 Password |
| 98 |
* @var string
|
|
| 98 |
* @var string |
|
| 99 | 99 |
*/ |
| 100 | 100 |
var $password; |
| 101 | 101 |
|
| 102 | 102 |
/**#@+ |
| 103 |
* @access private
|
|
| 103 |
* @access private |
|
| 104 | 104 |
*/ |
| 105 | 105 |
var $pop_conn; |
| 106 | 106 |
var $connected; |
| ... | ... | |
| 110 | 110 |
/** |
| 111 | 111 |
* Constructor, sets the initial values |
| 112 | 112 |
* |
| 113 |
* @return POP3
|
|
| 113 |
* @return POP3 |
|
| 114 | 114 |
*/ |
| 115 | 115 |
function POP3 () |
| 116 | 116 |
{
|
| ... | ... | |
| 122 | 122 |
/** |
| 123 | 123 |
* Combination of public events - connect, login, disconnect |
| 124 | 124 |
* |
| 125 |
* @param string $host
|
|
| 126 |
* @param integer $port
|
|
| 127 |
* @param integer $tval
|
|
| 128 |
* @param string $username
|
|
| 129 |
* @param string $password
|
|
| 125 |
* @param string $host |
|
| 126 |
* @param integer $port |
|
| 127 |
* @param integer $tval |
|
| 128 |
* @param string $username |
|
| 129 |
* @param string $password |
|
| 130 | 130 |
*/ |
| 131 | 131 |
function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) |
| 132 | 132 |
{
|
| ... | ... | |
| 184 | 184 |
/** |
| 185 | 185 |
* Connect to the POP3 server |
| 186 | 186 |
* |
| 187 |
* @param string $host
|
|
| 188 |
* @param integer $port
|
|
| 189 |
* @param integer $tval
|
|
| 190 |
* @return boolean
|
|
| 187 |
* @param string $host |
|
| 188 |
* @param integer $port |
|
| 189 |
* @param integer $tval |
|
| 190 |
* @return boolean |
|
| 191 | 191 |
*/ |
| 192 | 192 |
function Connect ($host, $port = false, $tval = 30) |
| 193 | 193 |
{
|
| ... | ... | |
| 270 | 270 |
/** |
| 271 | 271 |
* Login to the POP3 server (does not support APOP yet) |
| 272 | 272 |
* |
| 273 |
* @param string $username
|
|
| 274 |
* @param string $password
|
|
| 275 |
* @return boolean
|
|
| 273 |
* @param string $username |
|
| 274 |
* @param string $password |
|
| 275 |
* @return boolean |
|
| 276 | 276 |
*/ |
| 277 | 277 |
function Login ($username = '', $password = '') |
| 278 | 278 |
{
|
| ... | ... | |
| 344 | 344 |
* Get the socket response back. |
| 345 | 345 |
* $size is the maximum number of bytes to retrieve |
| 346 | 346 |
* |
| 347 |
* @param integer $size
|
|
| 348 |
* @return string
|
|
| 347 |
* @param integer $size |
|
| 348 |
* @return string |
|
| 349 | 349 |
*/ |
| 350 | 350 |
function getResponse ($size = 128) |
| 351 | 351 |
{
|
| ... | ... | |
| 357 | 357 |
/** |
| 358 | 358 |
* Send a string down the open socket connection to the POP3 server |
| 359 | 359 |
* |
| 360 |
* @param string $string
|
|
| 361 |
* @return integer
|
|
| 360 |
* @param string $string |
|
| 361 |
* @return integer |
|
| 362 | 362 |
*/ |
| 363 | 363 |
function sendString ($string) |
| 364 | 364 |
{
|
| ... | ... | |
| 371 | 371 |
/** |
| 372 | 372 |
* Checks the POP3 server response for +OK or -ERR |
| 373 | 373 |
* |
| 374 |
* @param string $string
|
|
| 375 |
* @return boolean
|
|
| 374 |
* @param string $string |
|
| 375 |
* @return boolean |
|
| 376 | 376 |
*/ |
| 377 | 377 |
function checkResponse ($string) |
| 378 | 378 |
{
|
| ... | ... | |
| 417 | 417 |
/** |
| 418 | 418 |
* Takes over from PHP for the socket warning handler |
| 419 | 419 |
* |
| 420 |
* @param integer $errno
|
|
| 421 |
* @param string $errstr
|
|
| 422 |
* @param string $errfile
|
|
| 423 |
* @param integer $errline
|
|
| 420 |
* @param integer $errno |
|
| 421 |
* @param string $errstr |
|
| 422 |
* @param string $errfile |
|
| 423 |
* @param integer $errline |
|
| 424 | 424 |
*/ |
| 425 | 425 |
function catchWarning ($errno, $errstr, $errfile, $errline) |
| 426 | 426 |
{
|
| branches/2.8.x/wb/include/phpmailer/class.smtp.php | ||
|---|---|---|
| 60 | 60 |
var $do_verp = false; |
| 61 | 61 |
|
| 62 | 62 |
/**#@+ |
| 63 |
* @access private
|
|
| 63 |
* @access private |
|
| 64 | 64 |
*/ |
| 65 | 65 |
var $smtp_conn; # the socket to the server |
| 66 | 66 |
var $error; # error if any on the last call |
| ... | ... | |
| 69 | 69 |
|
| 70 | 70 |
/** |
| 71 | 71 |
* Initialize the class so that the data is in a known state. |
| 72 |
* @access public
|
|
| 73 |
* @return void
|
|
| 72 |
* @access public |
|
| 73 |
* @return void |
|
| 74 | 74 |
*/ |
| 75 | 75 |
function SMTP() {
|
| 76 | 76 |
$this->smtp_conn = 0; |
| ... | ... | |
| 94 | 94 |
* |
| 95 | 95 |
* SMTP CODE SUCCESS: 220 |
| 96 | 96 |
* SMTP CODE FAILURE: 421 |
| 97 |
* @access public
|
|
| 98 |
* @return bool
|
|
| 97 |
* @access public |
|
| 98 |
* @return bool |
|
| 99 | 99 |
*/ |
| 100 | 100 |
function Connect($host,$port=0,$tval=30) {
|
| 101 | 101 |
# set the error val to null so there is no confusion |
| ... | ... | |
| 155 | 155 |
/** |
| 156 | 156 |
* Performs SMTP authentication. Must be run after running the |
| 157 | 157 |
* Hello() method. Returns true if successfully authenticated. |
| 158 |
* @access public
|
|
| 159 |
* @return bool
|
|
| 158 |
* @access public |
|
| 159 |
* @return bool |
|
| 160 | 160 |
*/ |
| 161 | 161 |
function Authenticate($username, $password) {
|
| 162 | 162 |
// Start authentication |
| ... | ... | |
| 218 | 218 |
|
| 219 | 219 |
/** |
| 220 | 220 |
* Returns true if connected to a server otherwise false |
| 221 |
* @access private
|
|
| 222 |
* @return bool
|
|
| 221 |
* @access private |
|
| 222 |
* @return bool |
|
| 223 | 223 |
*/ |
| 224 | 224 |
function Connected() {
|
| 225 | 225 |
if(!empty($this->smtp_conn)) {
|
| ... | ... | |
| 243 | 243 |
* Closes the socket and cleans up the state of the class. |
| 244 | 244 |
* It is not considered good to use this function without |
| 245 | 245 |
* first trying to use QUIT. |
| 246 |
* @access public
|
|
| 247 |
* @return void
|
|
| 246 |
* @access public |
|
| 247 |
* @return void |
|
| 248 | 248 |
*/ |
| 249 | 249 |
function Close() {
|
| 250 | 250 |
$this->error = null; # so there is no confusion |
| ... | ... | |
| 276 | 276 |
* SMTP CODE FAILURE: 552,554,451,452 |
| 277 | 277 |
* SMTP CODE FAILURE: 451,554 |
| 278 | 278 |
* SMTP CODE ERROR : 500,501,503,421 |
| 279 |
* @access public
|
|
| 280 |
* @return bool
|
|
| 279 |
* @access public |
|
| 280 |
* @return bool |
|
| 281 | 281 |
*/ |
| 282 | 282 |
function Data($msg_data) {
|
| 283 | 283 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 415 | 415 |
* SMTP CODE SUCCESS: 250 |
| 416 | 416 |
* SMTP CODE FAILURE: 550 |
| 417 | 417 |
* SMTP CODE ERROR : 500,501,502,504,421 |
| 418 |
* @access public
|
|
| 419 |
* @return string array
|
|
| 418 |
* @access public |
|
| 419 |
* @return string array |
|
| 420 | 420 |
*/ |
| 421 | 421 |
function Expand($name) {
|
| 422 | 422 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 466 | 466 |
* |
| 467 | 467 |
* SMTP CODE SUCCESS: 250 |
| 468 | 468 |
* SMTP CODE ERROR : 500, 501, 504, 421 |
| 469 |
* @access public
|
|
| 470 |
* @return bool
|
|
| 469 |
* @access public |
|
| 470 |
* @return bool |
|
| 471 | 471 |
*/ |
| 472 | 472 |
function Hello($host="") {
|
| 473 | 473 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 498 | 498 |
|
| 499 | 499 |
/** |
| 500 | 500 |
* Sends a HELO/EHLO command. |
| 501 |
* @access private
|
|
| 502 |
* @return bool
|
|
| 501 |
* @access private |
|
| 502 |
* @return bool |
|
| 503 | 503 |
*/ |
| 504 | 504 |
function SendHello($hello, $host) {
|
| 505 | 505 |
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); |
| ... | ... | |
| 540 | 540 |
* |
| 541 | 541 |
* SMTP CODE SUCCESS: 211,214 |
| 542 | 542 |
* SMTP CODE ERROR : 500,501,502,504,421 |
| 543 |
* @access public
|
|
| 544 |
* @return string
|
|
| 543 |
* @access public |
|
| 544 |
* @return string |
|
| 545 | 545 |
*/ |
| 546 | 546 |
function Help($keyword="") {
|
| 547 | 547 |
$this->error = null; # to avoid confusion |
| ... | ... | |
| 592 | 592 |
* SMTP CODE SUCCESS: 250 |
| 593 | 593 |
* SMTP CODE SUCCESS: 552,451,452 |
| 594 | 594 |
* SMTP CODE SUCCESS: 500,501,421 |
| 595 |
* @access public
|
|
| 596 |
* @return bool
|
|
| 595 |
* @access public |
|
| 596 |
* @return bool |
|
| 597 | 597 |
*/ |
| 598 | 598 |
function Mail($from) {
|
| 599 | 599 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 635 | 635 |
* |
| 636 | 636 |
* SMTP CODE SUCCESS: 250 |
| 637 | 637 |
* SMTP CODE ERROR : 500, 421 |
| 638 |
* @access public
|
|
| 639 |
* @return bool
|
|
| 638 |
* @access public |
|
| 639 |
* @return bool |
|
| 640 | 640 |
*/ |
| 641 | 641 |
function Noop() {
|
| 642 | 642 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 678 | 678 |
* |
| 679 | 679 |
* SMTP CODE SUCCESS: 221 |
| 680 | 680 |
* SMTP CODE ERROR : 500 |
| 681 |
* @access public
|
|
| 682 |
* @return bool
|
|
| 681 |
* @access public |
|
| 682 |
* @return bool |
|
| 683 | 683 |
*/ |
| 684 | 684 |
function Quit($close_on_error=true) {
|
| 685 | 685 |
$this->error = null; # so there is no confusion |
| ... | ... | |
| 732 | 732 |
* SMTP CODE SUCCESS: 250,251 |
| 733 | 733 |
* SMTP CODE FAILURE: 550,551,552,553,450,451,452 |
| 734 | 734 |
* SMTP CODE ERROR : 500,501,503,421 |
| 735 |
* @access public
|
|
| 736 |
* @return bool
|
|
| 735 |
* @access public |
|
| 736 |
* @return bool |
|
| 737 | 737 |
*/ |
| 738 | 738 |
function Recipient($to) {
|
| 739 | 739 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 776 | 776 |
* |
| 777 | 777 |
* SMTP CODE SUCCESS: 250 |
| 778 | 778 |
* SMTP CODE ERROR : 500,501,504,421 |
| 779 |
* @access public
|
|
| 780 |
* @return bool
|
|
| 779 |
* @access public |
|
| 780 |
* @return bool |
|
| 781 | 781 |
*/ |
| 782 | 782 |
function Reset() {
|
| 783 | 783 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 825 | 825 |
* SMTP CODE SUCCESS: 250 |
| 826 | 826 |
* SMTP CODE SUCCESS: 552,451,452 |
| 827 | 827 |
* SMTP CODE SUCCESS: 500,501,502,421 |
| 828 |
* @access public
|
|
| 829 |
* @return bool
|
|
| 828 |
* @access public |
|
| 829 |
* @return bool |
|
| 830 | 830 |
*/ |
| 831 | 831 |
function Send($from) {
|
| 832 | 832 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 873 | 873 |
* SMTP CODE SUCCESS: 250 |
| 874 | 874 |
* SMTP CODE SUCCESS: 552,451,452 |
| 875 | 875 |
* SMTP CODE SUCCESS: 500,501,502,421 |
| 876 |
* @access public
|
|
| 877 |
* @return bool
|
|
| 876 |
* @access public |
|
| 877 |
* @return bool |
|
| 878 | 878 |
*/ |
| 879 | 879 |
function SendAndMail($from) {
|
| 880 | 880 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 921 | 921 |
* SMTP CODE SUCCESS: 250 |
| 922 | 922 |
* SMTP CODE SUCCESS: 552,451,452 |
| 923 | 923 |
* SMTP CODE SUCCESS: 500,501,502,421 |
| 924 |
* @access public
|
|
| 925 |
* @return bool
|
|
| 924 |
* @access public |
|
| 925 |
* @return bool |
|
| 926 | 926 |
*/ |
| 927 | 927 |
function SendOrMail($from) {
|
| 928 | 928 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 966 | 966 |
* SMTP CODE SUCCESS: 250 |
| 967 | 967 |
* SMTP CODE FAILURE: 502 |
| 968 | 968 |
* SMTP CODE ERROR : 500, 503 |
| 969 |
* @access public
|
|
| 970 |
* @return bool
|
|
| 969 |
* @access public |
|
| 970 |
* @return bool |
|
| 971 | 971 |
*/ |
| 972 | 972 |
function Turn() {
|
| 973 | 973 |
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
| ... | ... | |
| 988 | 988 |
* SMTP CODE SUCCESS: 250,251 |
| 989 | 989 |
* SMTP CODE FAILURE: 550,551,553 |
| 990 | 990 |
* SMTP CODE ERROR : 500,501,502,421 |
| 991 |
* @access public
|
|
| 992 |
* @return int
|
|
| 991 |
* @access public |
|
| 992 |
* @return int |
|
| 993 | 993 |
*/ |
| 994 | 994 |
function Verify($name) {
|
| 995 | 995 |
$this->error = null; # so no confusion is caused |
| ... | ... | |
| 1033 | 1033 |
* With SMTP we can tell if we have more lines to read if the |
| 1034 | 1034 |
* 4th character is '-' symbol. If it is a space then we don't |
| 1035 | 1035 |
* need to read anything else. |
| 1036 |
* @access private
|
|
| 1037 |
* @return string
|
|
| 1036 |
* @access private |
|
| 1037 |
* @return string |
|
| 1038 | 1038 |
*/ |
| 1039 | 1039 |
function get_lines() {
|
| 1040 | 1040 |
$data = ""; |
| branches/2.8.x/wb/include/yui/connection/connection_core.js | ||
|---|---|---|
| 26 | 26 |
YAHOO.util.Connect = |
| 27 | 27 |
{
|
| 28 | 28 |
/** |
| 29 |
* @description Array of MSFT ActiveX ids for XMLHttpRequest.
|
|
| 30 |
* @property _msxml_progid
|
|
| 31 |
* @private
|
|
| 32 |
* @static
|
|
| 33 |
* @type array
|
|
| 29 |
* @description Array of MSFT ActiveX ids for XMLHttpRequest. |
|
| 30 |
* @property _msxml_progid |
|
| 31 |
* @private |
|
| 32 |
* @static |
|
| 33 |
* @type array |
|
| 34 | 34 |
*/ |
| 35 | 35 |
_msxml_progid:[ |
| 36 | 36 |
'Microsoft.XMLHTTP', |
| ... | ... | |
| 39 | 39 |
], |
| 40 | 40 |
|
| 41 | 41 |
/** |
| 42 |
* @description Object literal of HTTP header(s)
|
|
| 43 |
* @property _http_header
|
|
| 44 |
* @private
|
|
| 45 |
* @static
|
|
| 46 |
* @type object
|
|
| 42 |
* @description Object literal of HTTP header(s) |
|
| 43 |
* @property _http_header |
|
| 44 |
* @private |
|
| 45 |
* @static |
|
| 46 |
* @type object |
|
| 47 | 47 |
*/ |
| 48 | 48 |
_http_headers:{},
|
| 49 | 49 |
|
| 50 | 50 |
/** |
| 51 |
* @description Determines if HTTP headers are set.
|
|
| 52 |
* @property _has_http_headers
|
|
| 53 |
* @private
|
|
| 54 |
* @static
|
|
| 55 |
* @type boolean
|
|
| 51 |
* @description Determines if HTTP headers are set. |
|
| 52 |
* @property _has_http_headers |
|
| 53 |
* @private |
|
| 54 |
* @static |
|
| 55 |
* @type boolean |
|
| 56 | 56 |
*/ |
| 57 | 57 |
_has_http_headers:false, |
| 58 | 58 |
|
| 59 | 59 |
/** |
| 60 |
* @description Determines if a default header of
|
|
| 60 |
* @description Determines if a default header of |
|
| 61 | 61 |
* Content-Type of 'application/x-www-form-urlencoded' |
| 62 | 62 |
* will be added to any client HTTP headers sent for POST |
| 63 | 63 |
* transactions. |
| 64 |
* @property _use_default_post_header
|
|
| 65 |
* @private
|
|
| 66 |
* @static
|
|
| 67 |
* @type boolean
|
|
| 64 |
* @property _use_default_post_header |
|
| 65 |
* @private |
|
| 66 |
* @static |
|
| 67 |
* @type boolean |
|
| 68 | 68 |
*/ |
| 69 | 69 |
_use_default_post_header:true, |
| 70 | 70 |
|
| 71 | 71 |
/** |
| 72 |
* @description The default header used for POST transactions.
|
|
| 73 |
* @property _default_post_header
|
|
| 74 |
* @private
|
|
| 75 |
* @static
|
|
| 76 |
* @type boolean
|
|
| 72 |
* @description The default header used for POST transactions. |
|
| 73 |
* @property _default_post_header |
|
| 74 |
* @private |
|
| 75 |
* @static |
|
| 76 |
* @type boolean |
|
| 77 | 77 |
*/ |
| 78 | 78 |
_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8', |
| 79 | 79 |
|
| 80 | 80 |
/** |
| 81 |
* @description The default header used for transactions involving the
|
|
| 81 |
* @description The default header used for transactions involving the |
|
| 82 | 82 |
* use of HTML forms. |
| 83 |
* @property _default_form_header
|
|
| 84 |
* @private
|
|
| 85 |
* @static
|
|
| 86 |
* @type boolean
|
|
| 83 |
* @property _default_form_header |
|
| 84 |
* @private |
|
| 85 |
* @static |
|
| 86 |
* @type boolean |
|
| 87 | 87 |
*/ |
| 88 | 88 |
_default_form_header:'application/x-www-form-urlencoded', |
| 89 | 89 |
|
| 90 | 90 |
/** |
| 91 |
* @description Determines if a default header of
|
|
| 91 |
* @description Determines if a default header of |
|
| 92 | 92 |
* 'X-Requested-With: XMLHttpRequest' |
| 93 | 93 |
* will be added to each transaction. |
| 94 |
* @property _use_default_xhr_header
|
|
| 95 |
* @private
|
|
| 96 |
* @static
|
|
| 97 |
* @type boolean
|
|
| 94 |
* @property _use_default_xhr_header |
|
| 95 |
* @private |
|
| 96 |
* @static |
|
| 97 |
* @type boolean |
|
| 98 | 98 |
*/ |
| 99 | 99 |
_use_default_xhr_header:true, |
| 100 | 100 |
|
| 101 | 101 |
/** |
Also available in: Unified diff
fixed headerinfos