Merge pull request #12173 from MrPetovan/bug/mail-headers-crlf
mail() requires additional headers to be separated by CRLF
This commit is contained in:
commit
21d1659982
|
@ -135,14 +135,15 @@ class Email implements IEmail
|
||||||
$headerString = '';
|
$headerString = '';
|
||||||
|
|
||||||
foreach ($this->additionalMailHeader as $name => $values) {
|
foreach ($this->additionalMailHeader as $name => $values) {
|
||||||
if (is_array($values)) {
|
if (!is_array($values)) {
|
||||||
foreach ($values as $value) {
|
$values = [$values];
|
||||||
$headerString .= "$name: $value\n";
|
}
|
||||||
}
|
|
||||||
} else {
|
foreach ($values as $value) {
|
||||||
$headerString .= "$name: $values\n";
|
$headerString .= "$name: $value\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $headerString;
|
return $headerString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,9 +163,9 @@ class Emailer
|
||||||
|
|
||||||
// generate a multipart/alternative message header
|
// generate a multipart/alternative message header
|
||||||
$messageHeader = $email->getAdditionalMailHeaderString() .
|
$messageHeader = $email->getAdditionalMailHeaderString() .
|
||||||
"From: $fromName <{$fromAddress}>\n" .
|
"From: $fromName <{$fromAddress}>\r\n" .
|
||||||
"Reply-To: $fromName <{$replyTo}>\n" .
|
"Reply-To: $fromName <{$replyTo}>\r\n" .
|
||||||
"MIME-Version: 1.0\n" .
|
"MIME-Version: 1.0\r\n" .
|
||||||
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
|
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
|
||||||
|
|
||||||
// assemble the final multipart message body with the text and html types included
|
// assemble the final multipart message body with the text and html types included
|
||||||
|
|
Loading…
Reference in New Issue
Block a user