It's taken me a while to understand the problem, let alone the answer.
As it looks now:
Newsletter module worked great on a Linux server.
Was moved to a Windows XP box.
Newsletters immediately arrived with a "line too long" error and didn't display. The content was blank, as per the error.
I added extra stuff to Mailer.php
function QuotedPrintable_encode($quotprint) {
$quotprint = (string) str_replace("\r\n",chr(13).chr(10),$quotprint);
$quotprint = (string) str_replace("\r\n", chr(13).chr(10),$quotprint);
$quotprint = (string) preg_replace("~([\x01-\x1F\x3D\x7F-\xFF])~e", "sprintf('=%02X', ord('\\1'))", $quotprint);
//$quotprint = (string) str_replace('\=0D=0A',"=0D=0A",$quotprint);
$quotprint = (string) str_replace("=0D=0A","\r\n",$quotprint);
$quotprint = (string) str_replace("=0A=0D","\r\n",$quotprint);
$quotprint = (string) str_replace("=0D","\r\n",$quotprint);
$quotprint = (string) str_replace("=0A","\r\n",$quotprint);
$quotprint = (string) str_replace("=0C","\r\n",$quotprint);
$quotprint = (string) str_replace("=09","\r\n",$quotprint);
$quotprint = (string) str_replace("=20","\r\n",$quotprint);
$quotprint = (string) str_replace("=3D","=",$quotprint);
return (string) $quotprint;
}
(bit of a scattergun approach)
Newsletters now arrive displaying almost correctly.
The remaining problem now is that SOME spaces, every now and then, are removed. As in:
"We havethe best selection of goods with a great price range so youcan choose the best present"
I've looked at the HTML code inside TinyMCE and it looks absolutely normal. All the spaces are there.
Any suggestions as to how to make sure all the spaces appear on the Newsletter?
Wild guesses, even?