-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I investigated the next issue. The Mailer class contains static PHPMailer instance. When user clicks Mail::send() function than the Mailer::send() function is called. The Mailer::send() function calls $mailer->addReplyTo(), $mailer->addCC() and $mailer->addBCC() functions. Because PHPMailer is static it keeps all these recipients and nobody clears them. When server sends emails to users (for example on email validation stage) it becomes insert all these recipients to each concrete email that must be delivered only to single mail box. But now each email contains few recipients.
I fixed this by inserting this 3 lines to the Mailer::send() function:
if (static::validate($mail)) {
$mail = $mail->getMail();
static::$mailer->clearAddresses();
static::$mailer->clearCCs();
static::$mailer->clearBCCs();But maybe there is better solution.
Metadata
Metadata
Assignees
Labels
No labels