i have sent a form to my email using mail() in php , in that i have used <br /> to get the feilds data in list format . but im getting the <br /> as well with the message and im not getting the format that i wanted. what's wrong?
BR tag doesn't work in php emails
Collapse
X
-
Sounds like you're sending in text-only mode. To send as HTML, use the HTML example on php.net: http://us2.php.net/manual/en/function.mail.p hp#id3111223 -
Welcome to TSDN!
As the previous post stated you are probably running text.
But when that is your intention you must use newlines to break a line, so you'd insert [php]"\n\r"[/php] (within double quotes!) instead of the <br>.
RonaldComment
-
I think there are issues doing the \n\r in that order. Most of the time systems will use and expect \r\nComment
-
-
Originally posted by venkat1sorr! guys i'm not getting ,can u people plz explain me little bit more abt the <br />
So this is for text-only, like in a text area, editor, a text file, etc.
The <br> tag is a HTML tags and is is used when you want to end a line in a HTML display, but don't want to start a new paragraph. The <br> tag forces a HTML line break wherever you place it.
This is used when displaying text in a HTML document.
In your case, an text-only e-mail message is treated as plain text, i.e. you use the markup for text data such as carriage return and line feed.
When your e-mail message is sent as HTML, you use the <br> to break a line in the output.
RonaldComment
Comment