Getting double line breaks when send with mail...


I've been searching on and off for a few weeks to get rid of double line breaks (\n\n) when I send e-mail via the mail command (in text format, not HTML)
For example, if I send a $message looking like :
line1
line2

line4

... I get in the e-mail :

line1

line2



line4

I've tried replacing \n\n with \n but the regexp doesn't seem to find any double line breaks so it doesn't remove them...

I've tried :
$message = ereg_replace("\n\n","\n",$message);
and
$message = str_replace("\n\n","\n",$message);

all with variations like with single and double quotes. The weirdest thing is I print out the $message after it's sent and when I check the source, I see only single line breaks! Any clues as to what is happening btw, I'm receiving the mails with Outlook XP.
Posted On: Wednesday 24th of October 2012 12:32:13 AM Total Views:  415
View Complete with Replies

RELATED TOPICS OF PHP PROGRAMMING LANGUAGE