@@ -273,8 +273,9 @@ discard block |
||
| 273 | 273 | { |
| 274 | 274 | $message = ''; |
| 275 | 275 | |
| 276 | - if(isset($this->attachments) && count($this->attachments) > 0) |
|
| 277 | - $message .= "--{$this->getBoundary()}" . self::LINE_BREAK; |
|
| 276 | + if(isset($this->attachments) && count($this->attachments) > 0) { |
|
| 277 | + $message .= "--{$this->getBoundary()}" . self::LINE_BREAK; |
|
| 278 | + } |
|
| 278 | 279 | |
| 279 | 280 | if( |
| 280 | 281 | isset($this->plainMessage) && strlen($this->plainMessage) > 0 && |
@@ -299,8 +300,7 @@ discard block |
||
| 299 | 300 | $message .= self::LINE_BREAK; |
| 300 | 301 | $message .= "--{$this->getAlternativeBoundary()}--" . self::LINE_BREAK; |
| 301 | 302 | $message .= self::LINE_BREAK; |
| 302 | - } |
|
| 303 | - else if(isset($this->plainMessage) && strlen($this->plainMessage)) |
|
| 303 | + } else if(isset($this->plainMessage) && strlen($this->plainMessage)) |
|
| 304 | 304 | { |
| 305 | 305 | if(isset($this->attachments) && count($this->attachments) > 0) |
| 306 | 306 | { |
@@ -310,8 +310,7 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | $message .= $this->plainMessage; |
| 312 | 312 | $message .= self::LINE_BREAK; |
| 313 | - } |
|
| 314 | - else if(isset($this->htmlMessage) && strlen($this->htmlMessage)) |
|
| 313 | + } else if(isset($this->htmlMessage) && strlen($this->htmlMessage)) |
|
| 315 | 314 | { |
| 316 | 315 | if(isset($this->attachments) && count($this->attachments) > 0) |
| 317 | 316 | { |
@@ -380,21 +379,23 @@ discard block |
||
| 380 | 379 | $headers .= "{$key}: {$value}" . self::LINE_BREAK; |
| 381 | 380 | } |
| 382 | 381 | |
| 383 | - if(count($this->cc) > 0) |
|
| 384 | - $headers .= 'CC: ' . implode(', ', $this->cc) . self::LINE_BREAK; |
|
| 385 | - if(count($this->bcc) > 0) |
|
| 386 | - $headers .= 'BCC: ' . implode(', ', $this->bcc) . self::LINE_BREAK; |
|
| 382 | + if(count($this->cc) > 0) { |
|
| 383 | + $headers .= 'CC: ' . implode(', ', $this->cc) . self::LINE_BREAK; |
|
| 384 | + } |
|
| 385 | + if(count($this->bcc) > 0) { |
|
| 386 | + $headers .= 'BCC: ' . implode(', ', $this->bcc) . self::LINE_BREAK; |
|
| 387 | + } |
|
| 387 | 388 | |
| 388 | - if(isset($this->attachments) && count($this->attachments) > 0) |
|
| 389 | - $headers .= "Content-Type: multipart/mixed; boundary=\"{$this->getBoundary()}\""; |
|
| 390 | - else if( |
|
| 389 | + if(isset($this->attachments) && count($this->attachments) > 0) { |
|
| 390 | + $headers .= "Content-Type: multipart/mixed; boundary=\"{$this->getBoundary()}\""; |
|
| 391 | + } else if( |
|
| 391 | 392 | isset($this->plainMessage) && strlen($this->plainMessage) > 0 && |
| 392 | 393 | isset($this->htmlMessage) && strlen($this->htmlMessage) > 0) |
| 393 | 394 | { |
| 394 | 395 | $headers .= "Content-Type: multipart/alternative; boundary=\"{$this->getAlternativeBoundary()}\""; |
| 396 | + } else if(isset($this->htmlMessage) && strlen($this->htmlMessage) > 0) { |
|
| 397 | + $headers .= 'Content-type: text/html; charset="iso-8859-1"'; |
|
| 395 | 398 | } |
| 396 | - else if(isset($this->htmlMessage) && strlen($this->htmlMessage) > 0) |
|
| 397 | - $headers .= 'Content-type: text/html; charset="iso-8859-1"'; |
|
| 398 | 399 | |
| 399 | 400 | return $headers; |
| 400 | 401 | } |