@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param string $address email address for the recipient |
| 73 | 73 | * @param string $title name of the recipient (optional) |
| 74 | 74 | |
| 75 | - * @return object instantiated $this |
|
| 75 | + * @return Archangel instantiated $this |
|
| 76 | 76 | */ |
| 77 | 77 | public function addTo($address, $title = '') |
| 78 | 78 | { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @param string $address email address for the cc recipient |
| 91 | 91 | * @param string $title name of the cc recipient (optional) |
| 92 | 92 | * |
| 93 | - * @return object instantiated $this |
|
| 93 | + * @return Archangel instantiated $this |
|
| 94 | 94 | */ |
| 95 | 95 | public function addCC($address, $title = '') |
| 96 | 96 | { |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * Setter method for adding bcc recipients |
| 107 | 107 | * |
| 108 | - * @param string $addres email address for the bcc recipient |
|
| 108 | + * @param string $address email address for the bcc recipient |
|
| 109 | 109 | * @param string $title name of the bcc recipient (optional) |
| 110 | 110 | * |
| 111 | - * @return object instantiated $this |
|
| 111 | + * @return Archangel instantiated $this |
|
| 112 | 112 | */ |
| 113 | 113 | public function addBCC($address, $title = '') |
| 114 | 114 | { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param string $address email address for the sender |
| 127 | 127 | * @param string $title name of the sender (optional) |
| 128 | 128 | * |
| 129 | - * @return object instantiated $this |
|
| 129 | + * @return Archangel instantiated $this |
|
| 130 | 130 | */ |
| 131 | 131 | public function setFrom($address, $title = '') |
| 132 | 132 | { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @param string $address email address for the reply-to |
| 145 | 145 | * @param string $title name of the reply-to (optional) |
| 146 | 146 | * |
| 147 | - * @return object instantiated $this |
|
| 147 | + * @return Archangel instantiated $this |
|
| 148 | 148 | */ |
| 149 | 149 | public function setReplyTo($address, $title = '') |
| 150 | 150 | { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | * |
| 162 | 162 | * @param string $subject subject for the email |
| 163 | 163 | * |
| 164 | - * @return object instantiated $this |
|
| 164 | + * @return Archangel instantiated $this |
|
| 165 | 165 | */ |
| 166 | 166 | public function setSubject($subject) |
| 167 | 167 | { |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @param string $message the plain-text message |
| 177 | 177 | * |
| 178 | - * @return object instantiated $this |
|
| 178 | + * @return Archangel instantiated $this |
|
| 179 | 179 | */ |
| 180 | 180 | public function setPlainMessage($message) |
| 181 | 181 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * |
| 190 | 190 | * @param string $message the html message |
| 191 | 191 | * |
| 192 | - * @return object instantiated $this |
|
| 192 | + * @return Archangel instantiated $this |
|
| 193 | 193 | */ |
| 194 | 194 | public function setHTMLMessage($message) |
| 195 | 195 | { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * @param string $type mime type of the file |
| 206 | 206 | * @param string $title the title of the attachment (optional) |
| 207 | 207 | * |
| 208 | - * @return object instantiated $this |
|
| 208 | + * @return Archangel instantiated $this |
|
| 209 | 209 | */ |
| 210 | 210 | public function addAttachment($path, $type, $title = '') |
| 211 | 211 | { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | /** |
| 245 | 245 | * Main instantiator for the class |
| 246 | 246 | * |
| 247 | - * @return object instantiated $this |
|
| 247 | + * @return Archangel instantiated $this |
|
| 248 | 248 | */ |
| 249 | 249 | public static function instance() |
| 250 | 250 | { |
@@ -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; |