BUGFIX: Applied/edited paradigmincarnate's patch to quote plaintext email with htmlEmail (#5120)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108396 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Luke Hudson 2010-07-23 02:44:15 +00:00 committed by Sam Minnee
parent 818ef70018
commit 15f54073b7

View File

@ -72,7 +72,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($plainContent,120));
$plainPart = processHeaders($headers, ($plainEncoding == "base64") ? chunk_split(base64_encode($plainContent),60) : wordwrap(QuotedPrintable_encode($plainContent),120));
// Make the HTML part
$headers["Content-Type"] = "text/html; charset=\"utf-8\"";
@ -83,10 +83,10 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $
$htmlContent =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n" .
"<HTML><HEAD>\n" .
"<META http-equiv=Content-Type content=\"text/html; charset=utf-8\">\n" .
"<STYLE type=3Dtext/css></STYLE>\n\n".
"<META http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n" .
"<STYLE type=\"text/css\"></STYLE>\n\n".
"</HEAD>\n" .
"<BODY bgColor=#ffffff>\n" .
"<BODY bgColor=\"#ffffff\">\n" .
$htmlContent .
"\n</BODY>\n" .
"</HTML>";