Re: Re: Breaking up new lines for e-mail

From: Date: Wed, 08 Jan 2003 02:13:32 +0000
Subject: Re: Re: Breaking up new lines for e-mail
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24637@lists.php.net to get a copy of this message
on 1/7/03 7:41 PM, Gavin Amm at Gavin@ksg.com.au appended the following bits to my mbox: > For example, they might type in the following (between the dashed > lines): > ------------------------------ > Hi, > > Please send me some info. > > Thanks, > Gav > ------------------------------ > > When I receive the mail, however, it looks like this: > ------------------------------ > Hi, Please send me some info. Thanks, Gav > ------------------------------ > > This is fine for such a short message, but lengthy messages would be > horrid to read if all the line breaks were taken out... This probably should be on PHP-General, since it isn't related to databases. That said and not having seen the code, I'm wondering if the user may be submitting the form from a Macintosh computer which uses carriage returns as end of line characters. If that were the case, they might not show up in a windows email client as line breaks. You might want to convert all line breaks to Windows style CRLF, that is "\r\n". It may be that CRLF is required by one of the email RFCs. Something like: $text = str_replace("\r\n","\n",$text); // windows to unix $text = str_replace("\r","\n",$text); // mac to unix $text = str_replace("\n","\r\n",$text); // all to windows HTH. Sincerely, Paul Burney -- I'm inhaling Caesar's last gasp... http://paul.burney.ws/thoughts/caesars_breath.html

« previous php.db (#24637) next »