Welcome to WebmasterWorld Guest from 188.8.131.52
often doesn't work with an Apache server.
$messageText .= $messageText ."<br>";
for each line break needed.
Quite why the HTML tag works without breaking out of PHP is beyond
my ken, but it does, every time !
I believe you are confused about two very different situations here. The mail headers do indeed require separation by newline, as per the mail RFC. Therefore, the
\r\nmust be coded properly.
However, if you are sending out HTML formatted mail, the only way to get your content separated is to use block elements in your HTML that are going to "push" the next block of information below the previous. An alternative is to wrap your $messageText in a set of HTML <pre></pre> tags and code your newlines that way.
To summarize, there is a difference between coding the message headers and the message content (body) itself.