Skip to content

Commit 6988c22

Browse files
committed
fix: address PR review comments
- Remove redundant clearAddresses/clearBCCs/clearCCs calls since clearAllRecipients() already covers them - Add explicit ENCODING_BASE64 to file-path attachment branch for consistency with the string-content branch
1 parent a67be88 commit 6988c22

File tree

1 file changed

+1
-3
lines changed
  • src/Utopia/Messaging/Adapter/Email

1 file changed

+1
-3
lines changed

src/Utopia/Messaging/Adapter/Email/SMTP.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,9 @@ protected function process(EmailMessage $message): array
6161

6262
if ($this->keepAlive && $this->mail !== null) {
6363
$mail = $this->mail;
64-
$mail->clearAddresses();
6564
$mail->clearAllRecipients();
6665
$mail->clearReplyTos();
6766
$mail->clearAttachments();
68-
$mail->clearBCCs();
69-
$mail->clearCCs();
7067
} else {
7168
$mail = new PHPMailer();
7269
$mail->isSMTP();
@@ -142,6 +139,7 @@ protected function process(EmailMessage $message): array
142139
$mail->addStringAttachment(
143140
string: \file_get_contents($attachment->getPath()),
144141
filename: $attachment->getName(),
142+
encoding: PHPMailer::ENCODING_BASE64,
145143
type: $attachment->getType()
146144
);
147145
}

0 commit comments

Comments
 (0)