- Rewrite Email->getAdditionalMailHeaderString to have only one string concatenation statement
$headerString = '';
foreach ($this->additionalMailHeader as $name => $values) {
- if (is_array($values)) {
- foreach ($values as $value) {
- $headerString .= "$name: $value\n";
- }
- } else {
- $headerString .= "$name: $values\n";
+ if (!is_array($values)) {
+ $values = [$values];
+ }
+
+ foreach ($values as $value) {
+ $headerString .= "$name: $value\r\n";
}
}
+
return $headerString;
}
// generate a multipart/alternative message header
$messageHeader = $email->getAdditionalMailHeaderString() .
- "From: $fromName <{$fromAddress}>\n" .
- "Reply-To: $fromName <{$replyTo}>\n" .
- "MIME-Version: 1.0\n" .
+ "From: $fromName <{$fromAddress}>\r\n" .
+ "Reply-To: $fromName <{$replyTo}>\r\n" .
+ "MIME-Version: 1.0\r\n" .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
// assemble the final multipart message body with the text and html types included