471,602 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,602 software developers and data experts.

Sending Information to an email - but need new lines..

Hi there.

Basically, I need to send some details but be able to use new lines.
Before we were using asp, which used VbCrLf but now that im writing
the pages in PHP we need another way.

a code sample is:

$details =
"------------------------------------------------------------------------------"
.. '<br />' .
"WEBSITE RESPONSE - PACK REQUEST" . '<br>' .
"------------------------------------------------------------------------------"
.. '<br>' .'<br>' .

which should then look similar to:

------------------------------------------------------------------------------
WEBSITE RESPONSE - PACK REQUEST
------------------------------------------------------------------------------

when the email gets sent to the address, but at the moment, its being
sent through as:

------------------------------------------------------------------------------<br>WEBSITE
RESPONSE - SAMPLE PACK
REQUEST<br>------------------------------------------------------------------------------<br><br><strong>NEW


Now is this just because the email client (im testing with yahoo)
doesnt support html? or another reason.

Any ideas how i can fix this issue please.

Regards and thanks for the help

Sep 18 '06 #1
3 1169
It looks like you are not sending the email in "text/plain" instead of
"text/html". If you send it in "text/html" you will get your desired
results, if you want to send it in "text/plain" you will have to
replace your "<br />"'s with "\n\r" to signal a carriage return.

Advo wrote:
Hi there.

Basically, I need to send some details but be able to use new lines.
Before we were using asp, which used VbCrLf but now that im writing
the pages in PHP we need another way.

a code sample is:

$details =
"------------------------------------------------------------------------------"
. '<br />' .
"WEBSITE RESPONSE - PACK REQUEST" . '<br>' .
"------------------------------------------------------------------------------"
. '<br>' .'<br>' .

which should then look similar to:

------------------------------------------------------------------------------
WEBSITE RESPONSE - PACK REQUEST
------------------------------------------------------------------------------

when the email gets sent to the address, but at the moment, its being
sent through as:

------------------------------------------------------------------------------<br>WEBSITE
RESPONSE - SAMPLE PACK
REQUEST<br>------------------------------------------------------------------------------<br><br><strong>NEW


Now is this just because the email client (im testing with yahoo)
doesnt support html? or another reason.

Any ideas how i can fix this issue please.

Regards and thanks for the help
Sep 18 '06 #2

Nick DeNardis wrote:
It looks like you are not sending the email in "text/plain" instead of
"text/html". If you send it in "text/html" you will get your desired
results, if you want to send it in "text/plain" you will have to
replace your "<br />"'s with "\n\r" to signal a carriage return.

ahh i didnt realise you had to send differently for html.. is there a
certain parameter you have to pass or?

Sep 18 '06 #3
http://us2.php.net/manual/en/function.mail.php

Check out Example 4.

Advo wrote:
Nick DeNardis wrote:
It looks like you are not sending the email in "text/plain" instead of
"text/html". If you send it in "text/html" you will get your desired
results, if you want to send it in "text/plain" you will have to
replace your "<br />"'s with "\n\r" to signal a carriage return.


ahh i didnt realise you had to send differently for html.. is there a
certain parameter you have to pass or?
Sep 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Elliot M. Rodriguez | last post: by
6 posts views Thread by Rani | last post: by
6 posts views Thread by Anuradha | last post: by
7 posts views Thread by bleachie | last post: by
10 posts views Thread by Markgoldin | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.