Skip to content

Issue93:Removed unused code #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions config/mail.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
],
Expand Down
7 changes: 0 additions & 7 deletions src/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class Email extends Message

private ?string $htmlCharset = null;
private array $attachments = [];
private mixed $cachedBody;

public function subject(string $subject): static
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down