SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know how to make Outlook disaply line breaks in a email, when sent from a textarea in php?

    At the moment, it disaplys no line breaks at all, but Outlook express does.

    Peter

  2. #2
    SitePoint Zealot HotDog's Avatar
    Join Date
    May 2000
    Location
    Salt Lake City, UT
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is an article I found on the net at http://www.windowsitlibrary.com/Content/238/22/2.html#7. I'm not sure if this is the answer you are looking for, but I hope this helps...

    Forcing Line Breaks
    An Internet e-mail annoyance youíre likely to run into is the fact that some e-mail programs (such as Digitalís All-in-One or Netscape Navigator 2.0) do not automatically wrap lines to fit the display. Recipients may complain that they have to scroll far to the right to see all your paragraphs.

    Microsoft Exchange Server can be set to force default line lengths to help overcome some of these problems. This adjustment must be made by the Exchange Server administrator and affects all messages and users.

    However, the Internet Mail service does not offer any way to automatically break lines with a hard return at a certain length. Instead, you need to consider one of the following workarounds:
    Break lines yourself by pressing Enter where you want the break to occur.
    Use WordMail as your e-mail editor and a macro that inserts hard returns for you. An example of such a macro is included on the CD for this book.
    Use MIME with USASCII for your message format. However, the recipient may see an = character at the end of each line where a soft return is detected; and this method may not work for all recipients.
    Use UUENCODE with USASCII for the message format.
    Joe Eliason
    Just a dog learnin' PHP from cat.

  3. #3
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you want a simple line break such as
    this

    only add
    Code:
    \n
    where you want the break.
    or isn't this your problem ?

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the answer. I gotta do this:

    PHP Code:
    $text str_replace("<br>""\\n"$text); 
    And strangely, even for plain text messages, the <br> is parsed and displays a line break.

    Cool Huh


    Peter

  5. #5
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've forgot something:
    Code:
    $text = str_replace("<br>", "\n", $text);
    better now?

  6. #6
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yup

    Thanx

    Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •