[Webpro] PHP/MySQL linebreaks when sending newsletters

Mike S. Krischker info at webdesign-list.com
Thu Jan 6 03:23:03 EST 2005


Hello

I once had a customer who complained that he gets his own newsletter,
which is sent out by a script that we coded for his website, all in a
row, i. e. everything on one line, without line breaks. He was using
Outlook on Windows.

The issue was solved for him by replacing 'bad' line breaks like this,
after receiving $text from the MySQL database:

$text = ereg_replace( "\r\n","\n",$text );
$text = ereg_replace( "\r","\n",$text );
$nlText = wordwrap( $text,72 );

Since then, I used this snipped for other newsletter scripts as well.
Apparently some users get these newsletters with *double* line breaks,
i. e. every 2nd line is empty.  :(

Needless to say that on my system (now Win2K, then Win98), with any
tested mail client (Eudora, Outlook, TheBat), all these newsletters
looked fine. I tend to abandon the 'linebreak-replacing' now, but
would be very interested in your experiences, habits and practices
regarding this issue.

Thanks!

Mike



More information about the Webpro mailing list