On Wed, 21 Jul 2004 23:42:04 -0400, PHP User <[EMAIL PROTECTED]> wrote:
> I am using Outlook 2003 in text mode to view messages (which is what I
> want). 

AHA! Outlook, by default, removes "extra" line breaks in text
messages. Do you see a message which says this in Outlook? This is an
option you can turn off. If this doesn't work, just send the message
as HTML. There's really no reason not to, especially if you're in
Outlook.

> This is the relevent code...
> 
> .... Code for input from form .....
> 
> $text=str_replace("\n","\r\n",$text);

I've used the following to fix newlines:

$text=str_replace("\r\n","\n",$text);
$text=str_replace("\r","\n",$text);
$text=str_replace("\n","\r\n",$text);

> * this replaces \n before the email is sent. Not sure this is necessary or
> right, but nothing else I have tried works either *
> 
> if($mail->Send()) * email gets sent
> {
> 
> $text=str_replace("\n","<br>",$text);
> $text=str_replace("<br />","",$text);
> * these two lines make it display properly on my site *
> 
> ..... Code to display message ....
> 
> Thanks
> 
> 
> 
> -----Original Message-----
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: July 21, 2004 6:36 PM
> To: PHP User
> Cc: PHP
> Subject: Re: [PHP] Line breaks again....
> 
> PHP User wrote:
> 
> > I have managed to get the line breaks to show up on my site no problem,
> but
> > I still get one long line when it is sent to my email. I have looked and
> > looked and have read all the stuff I could find on \r\n, so I'm not sure
> > where to go from here since it's not working...
> 
> Are you viewing HTML email or plain text? Using \r\n or \n will work
> fine in most email viewers. Are you sure you're not stripping the \n
> from the text to show it with <br> in HTML and then screwing up the
> presentation in email? Hard to tell what you're doing without any
> code... hint hint...
> 
-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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

Reply via email to