email text formatting with linebreaks

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tehquickness
Forum Commoner
Posts: 32
Joined: Mon Oct 24, 2005 11:31 pm

email text formatting with linebreaks

Post by Tehquickness »

I have been creating my email function for my site and it works find and sends the mail. My problem is that I use a area text for the message input with word wrap. The word wrap works correctly but if the user hits the enter key to move to the next line then the message will come out something liek this

theis a test for the word wrap
jibberish tes of the words and their wrapping of the words
wrap well then this will wrap the worksa asdrounadkjasfd;aiojseaf
askdjfis sdafkljsdfasiuejj akdja;sd ajdf jadjf akjdf aieu ja jd;fj
aie ajd kjadsfj aej ajsdf j;ajdfjae\r\n\r\n\r\natest \r\nteat
\r\n\r\n\r\n asfetss


see the problem is when the mail is read by the person who opens it the line breaks dont register as line breaks for some reason. I am not sure how to correct this problem.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

looks like magic quotes is on. stripslashes() might help.
Post Reply