@@ -182,18 +182,18 @@ discard block |
||
| 182 | 182 | $this->message = $message; |
| 183 | 183 | |
| 184 | 184 | $this->connect() |
| 185 | - ->ehlo(); |
|
| 185 | + ->ehlo(); |
|
| 186 | 186 | |
| 187 | 187 | if ($this->tls) { |
| 188 | 188 | $this->starttls() |
| 189 | - ->ehlo(); |
|
| 189 | + ->ehlo(); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | $this->authLogin() |
| 193 | - ->mailFrom() |
|
| 194 | - ->rcptTo() |
|
| 195 | - ->data() |
|
| 196 | - ->quit(); |
|
| 193 | + ->mailFrom() |
|
| 194 | + ->rcptTo() |
|
| 195 | + ->data() |
|
| 196 | + ->quit(); |
|
| 197 | 197 | |
| 198 | 198 | if (is_resource($this->smtp)) { |
| 199 | 199 | return fclose($this->smtp); |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | - * Connect to server |
|
| 225 | - * @return $this |
|
| 226 | - * @throws SMTPException |
|
| 227 | - * @throws SMTPRetunCodeException |
|
| 228 | - */ |
|
| 224 | + * Connect to server |
|
| 225 | + * @return $this |
|
| 226 | + * @throws SMTPException |
|
| 227 | + * @throws SMTPRetunCodeException |
|
| 228 | + */ |
|
| 229 | 229 | protected function connect(): self |
| 230 | 230 | { |
| 231 | 231 | $host = $this->ssl ? 'ssl://' . $this->host : $this->host; |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | - * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ... |
|
| 261 | - * |
|
| 262 | - * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS |
|
| 263 | - * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2 |
|
| 264 | - * - On PHP 5.6.7-7.1.* it means only TLS 1.0 |
|
| 265 | - * |
|
| 266 | - * We want the negotiation, so we'll force it below ... |
|
| 267 | - */ |
|
| 260 | + * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ... |
|
| 261 | + * |
|
| 262 | + * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS |
|
| 263 | + * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2 |
|
| 264 | + * - On PHP 5.6.7-7.1.* it means only TLS 1.0 |
|
| 265 | + * |
|
| 266 | + * We want the negotiation, so we'll force it below ... |
|
| 267 | + */ |
|
| 268 | 268 | if (is_resource($this->smtp)) { |
| 269 | 269 | if ( |
| 270 | 270 | !stream_socket_enable_crypto( |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected string $body = ''; |
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * The mail attachments |
|
| 109 | - * @var array<int, array<string, string>> |
|
| 110 | - */ |
|
| 107 | + /** |
|
| 108 | + * The mail attachments |
|
| 109 | + * @var array<int, array<string, string>> |
|
| 110 | + */ |
|
| 111 | 111 | protected array $attachments = []; |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * The mail headers |
|
| 115 | - * @var array<string, mixed> |
|
| 116 | - */ |
|
| 113 | + /** |
|
| 114 | + * The mail headers |
|
| 115 | + * @var array<string, mixed> |
|
| 116 | + */ |
|
| 117 | 117 | protected array $headers = []; |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
| 289 | - * {@inheritedoc} |
|
| 290 | - */ |
|
| 289 | + * {@inheritedoc} |
|
| 290 | + */ |
|
| 291 | 291 | public function setReplyTo(string $email, ?string $name = null): self |
| 292 | 292 | { |
| 293 | 293 | $this->replyTo = $this->formatHeader($email, $name); |
@@ -461,17 +461,17 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | $this->addHeader('X-Priority', $this->priority) |
| 464 | - ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
| 465 | - ->addHeader('Subject', $this->subject) |
|
| 466 | - ->addHeader('To', join(', ', $this->to)) |
|
| 467 | - ->addHeader('Date', date('r')); |
|
| 464 | + ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
| 465 | + ->addHeader('Subject', $this->subject) |
|
| 466 | + ->addHeader('To', join(', ', $this->to)) |
|
| 467 | + ->addHeader('Date', date('r')); |
|
| 468 | 468 | |
| 469 | 469 | if ($this->hasAttachments()) { |
| 470 | 470 | $this->addHeader('MIME-Version', '1.0') |
| 471 | - ->addHeader( |
|
| 472 | - 'Content-Type', |
|
| 473 | - sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
| 474 | - ); |
|
| 471 | + ->addHeader( |
|
| 472 | + 'Content-Type', |
|
| 473 | + sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
| 474 | + ); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | return $this; |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | protected function filterEmail(string $email): string |
| 574 | 574 | { |
| 575 | 575 | $rules = [ |
| 576 | - "\r" => '', |
|
| 576 | + "\r" => '', |
|
| 577 | 577 | "\n" => '', |
| 578 | 578 | "\t" => '', |
| 579 | 579 | '"' => '', |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | protected function filterName(string $name): string |
| 597 | 597 | { |
| 598 | 598 | $rules = [ |
| 599 | - "\r" => '', |
|
| 599 | + "\r" => '', |
|
| 600 | 600 | "\n" => '', |
| 601 | 601 | "\t" => '', |
| 602 | 602 | '"' => "'", |