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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux