@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function send() |
| 229 | 229 | { |
| 230 | - if($this->passed_validation === FALSE) |
|
| 230 | + if ($this->passed_validation === FALSE) |
|
| 231 | 231 | return false; |
| 232 | 232 | |
| 233 | - if(!$this->check_required_fields()) |
|
| 233 | + if (!$this->check_required_fields()) |
|
| 234 | 234 | return false; |
| 235 | 235 | |
| 236 | 236 | $to = $this->get_to(); |
@@ -286,14 +286,14 @@ discard block |
||
| 286 | 286 | { |
| 287 | 287 | $message = ''; |
| 288 | 288 | |
| 289 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 289 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 290 | 290 | $message .= "--{$this->get_boundary()}" . self::$LINE_BREAK; |
| 291 | 291 | |
| 292 | - if( |
|
| 292 | + if ( |
|
| 293 | 293 | isset($this->plain_message) && strlen($this->plain_message) > 0 && |
| 294 | 294 | isset($this->html_message) && strlen($this->html_message) > 0) |
| 295 | 295 | { |
| 296 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 296 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 297 | 297 | { |
| 298 | 298 | $message .= "Content-Type: multipart/alternative; boundary={$this->get_alternative_boundary()}" . self::$LINE_BREAK; |
| 299 | 299 | $message .= self::$LINE_BREAK; |
@@ -313,9 +313,9 @@ discard block |
||
| 313 | 313 | $message .= "--{$this->get_alternative_boundary()}--" . self::$LINE_BREAK; |
| 314 | 314 | $message .= self::$LINE_BREAK; |
| 315 | 315 | } |
| 316 | - else if(isset($this->plain_message) && strlen($this->plain_message)) |
|
| 316 | + else if (isset($this->plain_message) && strlen($this->plain_message)) |
|
| 317 | 317 | { |
| 318 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 318 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 319 | 319 | { |
| 320 | 320 | $message .= 'Content-Type: text/plain; charset="iso-8859"' . self::$LINE_BREAK; |
| 321 | 321 | $message .= 'Content-Transfer-Encoding: 7bit' . self::$LINE_BREAK; |
@@ -324,9 +324,9 @@ discard block |
||
| 324 | 324 | $message .= $this->plain_message; |
| 325 | 325 | $message .= self::$LINE_BREAK; |
| 326 | 326 | } |
| 327 | - else if(isset($this->html_message) && strlen($this->html_message)) |
|
| 327 | + else if (isset($this->html_message) && strlen($this->html_message)) |
|
| 328 | 328 | { |
| 329 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 329 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 330 | 330 | { |
| 331 | 331 | $message .= 'Content-Type: text/html; charset="iso-8859-1"' . self::$LINE_BREAK; |
| 332 | 332 | $message .= 'Content-Transfer-Encoding: 7bit' . self::$LINE_BREAK; |
@@ -335,9 +335,9 @@ discard block |
||
| 335 | 335 | $message .= $this->html_message; |
| 336 | 336 | $message .= self::$LINE_BREAK; |
| 337 | 337 | } |
| 338 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 338 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 339 | 339 | { |
| 340 | - foreach($this->attachment_array as $attachment) |
|
| 340 | + foreach ($this->attachment_array as $attachment) |
|
| 341 | 341 | { |
| 342 | 342 | $message .= "--{$this->get_boundary()}" . self::$LINE_BREAK; |
| 343 | 343 | $message .= "Content-Type: {$attachment->type}; name=\"{$attachment->title}\"" . self::$LINE_BREAK; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | private $boundary; |
| 362 | 362 | private function get_boundary() |
| 363 | 363 | { |
| 364 | - if(!isset($this->boundary)) |
|
| 364 | + if (!isset($this->boundary)) |
|
| 365 | 365 | $this->boundary = sprintf(self::$BOUNDARY_FORMAT, md5(date('r', time()) . self::$BOUNDARY_SALT)); |
| 366 | 366 | return $this->boundary; |
| 367 | 367 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | private $alternative_boundary; |
| 376 | 376 | private function get_alternative_boundary() |
| 377 | 377 | { |
| 378 | - if(!isset($this->alternative_boundary)) |
|
| 378 | + if (!isset($this->alternative_boundary)) |
|
| 379 | 379 | $this->alternative_boundary = sprintf(self::$ALTERNATIVE_BOUNDARY_FORMAT, md5(date('r', time()) . self::$ALTERNATIVE_BOUNDARY_SALT)); |
| 380 | 380 | return $this->alternative_boundary; |
| 381 | 381 | } |
@@ -388,25 +388,25 @@ discard block |
||
| 388 | 388 | private function get_additional_headers() |
| 389 | 389 | { |
| 390 | 390 | $headers = ''; |
| 391 | - foreach($this->header_array as $key => $value) |
|
| 391 | + foreach ($this->header_array as $key => $value) |
|
| 392 | 392 | { |
| 393 | 393 | $headers .= "{$key}: {$value}" . self::$LINE_BREAK; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - if(count($this->cc_array) > 0) |
|
| 396 | + if (count($this->cc_array) > 0) |
|
| 397 | 397 | $headers .= 'CC: ' . implode(', ', $this->cc_array) . self::$LINE_BREAK; |
| 398 | - if(count($this->bcc_array) > 0) |
|
| 398 | + if (count($this->bcc_array) > 0) |
|
| 399 | 399 | $headers .= 'BCC: ' . implode(', ', $this->bcc_array) . self::$LINE_BREAK; |
| 400 | 400 | |
| 401 | - if(isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 401 | + if (isset($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 402 | 402 | $headers .= "Content-Type: multipart/mixed; boundary=\"{$this->get_boundary()}\""; |
| 403 | - else if( |
|
| 403 | + else if ( |
|
| 404 | 404 | isset($this->plain_message) && strlen($this->plain_message) > 0 && |
| 405 | 405 | isset($this->html_message) && strlen($this->html_message) > 0) |
| 406 | 406 | { |
| 407 | 407 | $headers .= "Content-Type: multipart/alternative; boundary=\"{$this->get_alternative_boundary()}\""; |
| 408 | 408 | } |
| 409 | - else if(isset($this->html_message) && strlen($this->html_message) > 0) |
|
| 409 | + else if (isset($this->html_message) && strlen($this->html_message) > 0) |
|
| 410 | 410 | $headers .= 'Content-type: text/html; charset="iso-8859-1"'; |
| 411 | 411 | |
| 412 | 412 | return $headers; |