The karancan solution probably works, but the main reason is what Hobo said. The mail function inserts a line break every 900 characters (I think). Therefore, if you create your $ message with a bunch of $message .= "more text"; , you will encounter this error if this string is more than 900 characters. This is confusing because the spaces seem intermittent, especially if you are creating an HTML message because sometimes line breaks will appear in completely soft places.
A simple solution is to add \r\n\ to the end of the lines.
Interestingly, these forms work:
$message .= "<tr><td>1</td><td>2</td>\r\n"; $message .= '<tr><td>1</td><td>2</td>'."\r\n";
But this is not so:
$message .= '<tr><td>1</td><td>2</td>\r\n';
\r\n must be surrounded by double quotes, otherwise the characters will simply be added to the text instead of creating a carriage return / line.
Mordred
source share