Clean up after #1155

This commit is contained in:
Marcus Bointon 2017-09-14 14:49:01 +02:00
parent a120d9792f
commit 1bc0d46017
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
1 changed files with 14 additions and 6 deletions

View File

@ -1642,11 +1642,11 @@ class PHPMailer
if ($this->SingleTo and count($toArr) > 1) {
foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
$this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From,[]);
$this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
}
} else {
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
$this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From,[]);
$this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
}
if (isset($old_from)) {
ini_set('sendmail_from', $old_from);
@ -1720,6 +1720,7 @@ class PHPMailer
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
}
$callbacks = [];
// Attempt to send to all recipients
foreach ([$this->to, $this->cc, $this->bcc] as $togroup) {
foreach ($togroup as $to) {
@ -1749,10 +1750,17 @@ class PHPMailer
$this->smtp->close();
}
foreach ($callbacks as $cb)
{
$this->doCallback($cb['issent'],array($cb['to']),array(),array(),$this->Subject,$body,$this->From,
["smtp_transaction_id"=>$smtp_transaction_id]);
foreach ($callbacks as $cb) {
$this->doCallback(
$cb['issent'],
[$cb['to']],
[],
[],
$this->Subject,
$body,
$this->From,
['smtp_transaction_id' => $smtp_transaction_id]
);
}
//Create error message for any bad addresses