diff --git a/config/mail.global.php.dist b/config/mail.global.php.dist index 9ef3b30..ad0711d 100644 --- a/config/mail.global.php.dist +++ b/config/mail.global.php.dist @@ -66,8 +66,14 @@ return [ 'username' => '', //the smtp authentication credential 'password' => '', - //to disable auto_tls set tls key to false - //it's not recommended to disable TLS while connecting to an SMTP server + /** + * tls will run by default on this component, use: + * + * null - to avoid interfering with automatic encryption + * false - to disable automatic encryption + * + * It's not recommended to disable TLS while connecting to an SMTP server over the Internet + **/ 'tls' => null, ], ], diff --git a/src/Email.php b/src/Email.php index 547ff35..51f1c1f 100644 --- a/src/Email.php +++ b/src/Email.php @@ -49,7 +49,6 @@ class Email extends Message private ?string $htmlCharset = null; private array $attachments = []; - private mixed $cachedBody; public function subject(string $subject): static { @@ -198,7 +197,6 @@ public function getPriority(): int public function text(string $body, string $charset = 'utf-8'): static { - $this->cachedBody = null; $this->text = $body; $this->textCharset = $charset; @@ -229,7 +227,6 @@ public function getTextCharset(): ?string public function html(string $body, string $charset = 'utf-8'): static { - $this->cachedBody = null; $this->html = $body; $this->htmlCharset = $charset; @@ -275,10 +272,6 @@ private function ensureBodyValid(): void private function generateBody(): AbstractPart { - if (null !== $this->cachedBody) { - return $this->cachedBody; - } - $this->ensureBodyValid(); [$htmlPart, $otherParts, $relatedParts] = $this->prepareParts();