Sorting the Array problem in doCallback

This commit is contained in:
SirLouen 2025-08-17 13:18:53 +02:00
parent 800919c6a4
commit 97f4e58e18
1 changed files with 24 additions and 20 deletions

View File

@ -1842,9 +1842,10 @@ class PHPMailer
fwrite($mail, $body);
$result = pclose($mail);
$addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
foreach ($addrinfo as $addr) {
$this->doCallback(
($result === 0),
[[$addrinfo['address'], $addrinfo['name']]],
[[$addr['address'], $addr['name']]],
$this->cc,
$this->bcc,
$this->Subject,
@ -1852,6 +1853,7 @@ class PHPMailer
$this->From,
[]
);
}
$this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
if (0 !== $result) {
throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
@ -2017,9 +2019,10 @@ class PHPMailer
foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
$addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
foreach ($addrinfo as $addr) {
$this->doCallback(
$result,
[[$addrinfo['address'], $addrinfo['name']]],
[[$addr['address'], $addr['name']]],
$this->cc,
$this->bcc,
$this->Subject,
@ -2028,6 +2031,7 @@ class PHPMailer
[]
);
}
}
} else {
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
$this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);