Permalink
Browse files

BUGFIX #6240 Line length of emails sent out by Mailer.php set too lon…

…g and could cause emails to be marked as spam by certain filters (thanks florian.thoma!)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115155 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
halkyon committed Dec 17, 2010
1 parent fc31017 commit 6faf418693be0d8d61e0041516f19fd5c0799fe3
Showing with 4 additions and 4 deletions.
  1. +4 −4 email/Mailer.php
View
@@ -46,7 +46,7 @@ function sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = false, $c
function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $customheaders = false, $plainContent = false, $inlineImages = false) {
if ($customheaders && is_array($customheaders) == false) {
echo "htmlEmail($to, $from, $subject, ...) could not send mail: improper \$customheaders passed:<BR>";
- dieprintr($headers);
+ dieprintr($customheaders);
}
@@ -69,7 +69,7 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $
$headers["Content-Type"] = "text/plain; charset=\"utf-8\"";
$headers["Content-Transfer-Encoding"] = $plainEncoding ? $plainEncoding : "quoted-printable";
- $plainPart = processHeaders($headers, ($plainEncoding == "base64") ? chunk_split(base64_encode($plainContent),60) : wordwrap(QuotedPrintable_encode($plainContent),120));
+ $plainPart = processHeaders($headers, ($plainEncoding == "base64") ? chunk_split(base64_encode($plainContent),60) : wordwrap(QuotedPrintable_encode($plainContent),75));
// Make the HTML part
$headers["Content-Type"] = "text/html; charset=\"utf-8\"";
@@ -93,7 +93,7 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $
$htmlPart = wrapImagesInline($htmlContent);
} else {
$headers["Content-Transfer-Encoding"] = "quoted-printable";
- $htmlPart = processHeaders($headers, wordwrap(QuotedPrintable_encode($htmlContent),120));
+ $htmlPart = processHeaders($headers, wordwrap(QuotedPrintable_encode($htmlContent),75));
}
list($messageBody, $messageHeaders) = encodeMultipart(array($plainPart,$htmlPart), "multipart/alternative");
@@ -171,7 +171,7 @@ function plaintextEmail($to, $from, $subject, $plainContent, $attachedFiles, $cu
if ($customheaders && is_array($customheaders) == false) {
echo "htmlEmail($to, $from, $subject, ...) could not send mail: improper \$customheaders passed:<BR>";
- dieprintr($headers);
+ dieprintr($customheaders);
}
// If the subject line contains extended characters, we must encode it

0 comments on commit 6faf418

Please sign in to comment.