1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 15:57:01 +02:00

Fix issue processwire/processwire-issues#68 to workaround apparent PHP 7.1 mail() bug

This commit is contained in:
Ryan Cramer
2016-11-01 08:39:09 -04:00
parent fc8fa08275
commit e374bee288

View File

@@ -450,7 +450,12 @@ class WireMail extends WireData implements WireMailInterface {
foreach($this->to as $to) {
$toName = $this->mail['toName'][$to];
if($toName) $to = $this->bundleEmailAndName($to, $toName); // bundle to "User Name <user@example.com"
if(@mail($to, $this->encodeSubject($this->subject), $body, $header, $param)) $numSent++;
$subject = $this->encodeSubject($this->subject);
if($param) {
if(@mail($to, $subject, $body, $header, $param)) $numSent++;
} else {
if(@mail($to, $subject, $body, $header)) $numSent++;
}
}
return $numSent;