473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to have line breaks in this text

Hello,

I am going bananas trying to get text breaks and empty lines into this text
which is sent in an email.

I have tried "'s and \n and r\n\ but the text in the email still wraps and also
I see the code in the text.

Can anyone help me please as I have Googled and searched but to no avail.
This is it....
define('UNOTIFY_MESSAGE','Hello, You have requested a Response. Choose a pdf
file and download it. Read it then come back to this site. Use the email
address and password you used to Login into your Account. Thank you for
supporting us and enjoy your day');

----------------------------------
I want it to be like this..
Hello,

You have requested a Response.

Choose a pdf file and download it. Read it then come back to this site.

Use the email address and password you used to Login into your Account.

Thank you for supporting us and enjoy your day
------------------------------------------
Thank you in anticipation

rock

Nov 30 '06 #1
4 1599
<comp.lang.php>
<Rock>
<Thu, 30 Nov 2006 11:42:41 +1100>
<45**********************@news.optusnet.com.au>
This is it....
define('UNOTIFY_MESSAGE','Hello, You have requested a Response. Choose a pdf
file and download it. Read it then come back to this site. Use the email
address and password you used to Login into your Account. Thank you for
supporting us and enjoy your day');

----------------------------------
I want it to be like this..
Hello,

You have requested a Response.

Choose a pdf file and download it. Read it then come back to this site.

Use the email address and password you used to Login into your Account.

Thank you for supporting us and enjoy your day
Guesswork - your missing the <?php ?tags if you can see the code .

\n\n will do the line breaks for you .

<?php

$ewho="we*******@yourdomain.com";

$datesent=date("l dS of F Y h:i A");

$ip=$_SERVER['REMOTE_ADDR'];

$subject="FROM THE WEBSITE FORM";

$mailhead="From: $ewho \n";

$mailbody ="This email was sent via the website form" . "\n\n";
$mailbody .="DATE: " . "$datesent" . "\n\n";
$mailbody .="IP: " . "$ip" . "\n\n";
$mailbody .="Full Name: " . "$homer_01" . "\n\n";
$mailbody .="Email Address: " . "$homer_02" . "\n\n";
$mailbody .="Contact Number: " . "$homer_03" . "\n\n";

$body .=stripslashes($mailbody);

mail($ewho,$subject,$body,$mailhead);

?>
--
www.phpwhois.co.uk
Nov 30 '06 #2

Rock wrote:
Hello,

I am going bananas trying to get text breaks and empty lines into this text
which is sent in an email.

I have tried "'s and \n and r\n\ but the text in the email still wraps and also
I see the code in the text.

Can anyone help me please as I have Googled and searched but to no avail.
If you're "testing" it by echoing it out to your browser, \n's simply
won't do... you'd need to htmlify it with <BR />s

Nov 30 '06 #3
Rock:
I am going bananas trying to get text breaks and empty lines into this text
which is sent in an email.
Lines in an RFC2822 message are separated by
carriage-return/line-feed pairs. Bear in mind that lines are a
property of the data, not necessarily of the presentation of that data.
I have tried "'s and \n and r\n\ but the text in the email still wraps and also
I see the code in the text.
\r\n in a double-quoted string _is_ a CRLF pair. (I assume r\n\
was a typo.)

Short of using U+00A0 'NO-BREAK SPACE', the text would normally
wrap in smaller viewports.
define('UNOTIFY_MESSAGE','Hello, You have requested a Response. Choose a pdf
file and download it. Read it then come back to this site. Use the email
address and password you used to Login into your Account. Thank you for
supporting us and enjoy your day');
Since that string is single-quoted, \n and \r wouldn't be
interpreted. Either double quote the string or jump out of the
single-quotes and concatenate the CRLF pairs.

--
Jock

Nov 30 '06 #4
On Thu, 30 Nov 2006 11:42:41 +1100, in comp.lang.php Rock
<19**@pobox.com>
<45**********************@news.optusnet.com.auwrot e:
>| Hello,
|
| I am going bananas trying to get text breaks and empty lines into this text
| which is sent in an email.
|
| I have tried "'s and \n and r\n\ but the text in the email still wraps and also
| I see the code in the text.
|
| Can anyone help me please as I have Googled and searched but to no avail.
|
|
| This is it....
|
|
| define('UNOTIFY_MESSAGE','Hello, You have requested a Response. Choose a pdf
| file and download it. Read it then come back to this site. Use the email
| address and password you used to Login into your Account. Thank you for
| supporting us and enjoy your day');
|
| ----------------------------------
| I want it to be like this..
|
|
| Hello,
|
| You have requested a Response.
|
| Choose a pdf file and download it. Read it then come back to this site.
|
| Use the email address and password you used to Login into your Account.
|
| Thank you for supporting us and enjoy your day
| ------------------------------------------
In you're define statement you can use \n to force linefeeds.
When displaying this in a browser the \n will be ignored so you'll
need to use nl2br() to convert \n to <br />.
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Nov 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill | last post by:
I am downloading data from a website that displays it in a table $fp = fopen("a website page", 'r'); The following accesses the stream one <td> element at a time $myData = fgets($fp); Then I...
5
by: David Blickstein | last post by:
I'm finding it difficult to determine when/where XSLT generates line breaks when generating a text file <xsl:output method="text" media-type="text/plain"/> And... I'm getting thoroughly...
12
by: scott | last post by:
Is there a way to prevent IE from forcing a line break? Below in LISTING 2, you notice the table background image extention of '.jpg' begins a new line, instead of staying on the same line as it's...
3
by: les | last post by:
I am creating XML from SQL2000 using a vb.net page, then posting it to a remote server as a string. The remote server requires that the xml contain no line breaks, but there are some ntext...
7
by: David Meier | last post by:
Hi, I am new to C# and I am facing this small problem: I start a new process using cygwin and I redirect the standard output to a string variable. When I display the string variable in a list...
1
by: buran | last post by:
Dear ASP.NET Programmers, I am carrying the input of a textbox via querystring. When I put the value of querstring in a label control, the line breaks are removed. The whole text is displayed as...
2
by: Chris Schinzel | last post by:
Hi, I'm reading text from a html textarea field (standard wrap functionality, no value specified). If I display it via nl2br() (after html form submission), everything's ok. But if I send it via...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
8
by: Harris Kosmidis | last post by:
It seems I cannot understand CSS, well. I have donw the following page: http://www.pennias.gr/home.php It's in greek but the context is of no importance. I used a big table to put in my page...
4
by: alice | last post by:
Can someone tell me why, in IE7, the spaces in the footer (C 2007 ESSENCE) become line breaks on this this page http://s195679515.onlinehome.us/essence/index.html ?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.