I have a mailer that sends out to a bunch of people, I just changed servers and now when I send mail the line breaks from the $message variable (where I type the message to be sent out) are removed when it is emailed.
Originally it all came out in one block of text, but by inserting "\n" I can force line breaks in the pre and post packing of the $mailBody variable.
I don't know why the "\n" from $message is gone, or how to get it back! Shouldn't it be there automatically in a post variable from a text field?
Here is the relevant code.
// sql queries etc - all working fine
while($myrow=mysql_fetch_array($result))
{
$first_name = $myrow["f_name"];
$last_name = $myrow["l_name"];
$email = $myrow["email"];
$member_id = $myrow["member_id"];
$mailTo = "$email";
$mailSubject = "MULS - $first_name - $email_subject";
$mailBody = " -----------------------------------------------\n
Macquarie University Law Society\n
-----------------------------------------------\n
Dear $first_name,\n
\n
$message
\n
\n
-----------------------------------------------\n
";
$mailHeaders = "From: $reply";
$mailBody=stripslashes($mailBody);
mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
if($display_address == 1)
{
print("sent to:$member_id - $first_name $last_name - $email <br>");
}