473,569 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1235
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2958
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is...
8
1757
by: Elliot M. Rodriguez | last post by:
I am having a heckuva time debugging this, or determining why my page is behaving this way. I have a search form, that when completed, returns a datagrid. When the user selects a row (normal selectcommand button), i assign some session variables and perform a rediect to a "more information" page. Neither page is using Output Caching. On...
6
1393
by: Rani | last post by:
hi guys I need to send an email from a form the form is collecting data from a user and then submits it to us. I would like the email to appear in the following format Name: Email: Etc. all I was able to do so far is: strBody = "Name :" & strname & " Email :" & StrEmail etc.
9
3202
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on CDOmail. I don't want to use the Outlook reference because outlook prompts each time program access it and I have found a way to disable that. Can I...
6
2728
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
1
8161
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I...
9
3443
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient oSMTP.Send(oMailMessage) (in this line I am getting the above err)
7
3322
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of guests added. form.php function createGuestNameAndEmailElements() {
10
5058
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.