From 6faf418693be0d8d61e0041516f19fd5c0799fe3 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 17 Dec 2010 00:56:03 +0000 Subject: [PATCH] BUGFIX #6240 Line length of emails sent out by Mailer.php set too long 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 --- email/Mailer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/email/Mailer.php b/email/Mailer.php index 350564273..fe7557634 100644 --- a/email/Mailer.php +++ b/email/Mailer.php @@ -46,7 +46,7 @@ class Mailer extends Object { 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:
"; - 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:
"; - dieprintr($headers); + dieprintr($customheaders); } // If the subject line contains extended characters, we must encode it