473,320 Members | 1,535 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,320 software developers and data experts.

mail() problem - not formatting correctly

My code
<?php
$name = "freddie";

$message.="Hi Joe,\n";
$message.="\t $name has Filled out the form on the Website,\n";
$message.="The information from the form is listed below:\n";
$message.="more info\n";
$message.="more info\n";

mail("email address", "subject",$message,"FROM:email address");
?>

when this is run the email recieved is formatted :
Hi Joe,
freddie has Filled out the form on the Website, The information from
the form is listed below:
more info
more info

i would expect it to be formatted :

Hi Joe,
freddie has Filled out the form on the Website,
The information from the form is listed below:
more info
more info

Does anyone have any idea why this happens ???

--
¼á
Apr 13 '06 #1
6 1577
I would recommend using html formatting in your emails, so that then
you would put

<?php
$name = "freddie";

$message.="Hi Joe,<br>\r\n";
$message.="\t $name has Filled out the form on the Website,<br>\r\n";
$message.="The information from the form is listed below:<br>\r\n";
$message.="more info<br>\r\n";
$message.="more info<br>\r\n";

mail("email address", "subject",$message,"FROM:email address");
?>

Apr 14 '06 #2
I think it's something to do with the content-encoding. Don't throw in
html. It is obeying the rule for "more info" and not for the line
ending "website," which is odd, something to do with the comma?
(Clutching at straws!)

Could it be the email client you are using.

Also is the "From" working correctly? With qmail it only works when
it's like "From: jo*@doe.com\n"

Apr 14 '06 #3
chris wrote:
My code
<?php
$name = "freddie";

$message.="Hi Joe,\n";
$message.="\t $name has Filled out the form on the Website,\n";
$message.="The information from the form is listed below:\n";
$message.="more info\n";
$message.="more info\n";

mail("email address", "subject",$message,"FROM:email address");
?>

when this is run the email recieved is formatted :
Hi Joe,
freddie has Filled out the form on the Website, The information from
the form is listed below:
more info
more info

i would expect it to be formatted :

Hi Joe,
freddie has Filled out the form on the Website,
The information from the form is listed below:
more info
more info

Does anyone have any idea why this happens ???
--
¼á


Chris,

Hmmm, I haven't seen this problem before, although I have used mail() a fair amount.

Some thoughts - first of all, what happens if you change the \t to a couple of
spaces? Does that change things?

Also, what does the message's source look like? Is it possible your mail reader
is reformatting and you don't know it?

Finally - did you copy/paste the code, or did you retype it? If the latter, did
you accidentally correct your "problem" when retyping? :-)

But no - you do NOT want to insert html code into your message - especially the
header.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 14 '06 #4
"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:tb******************************@comcast.com. ..
chris wrote:
My code
<?php
$name = "freddie";

$message.="Hi Joe,\n";
$message.="\t $name has Filled out the form on the Website,\n";
$message.="The information from the form is listed below:\n";
$message.="more info\n";
$message.="more info\n";

mail("email address", "subject",$message,"FROM:email address");
?>

when this is run the email recieved is formatted :
Hi Joe,
freddie has Filled out the form on the Website, The information
from
the form is listed below:
more info
more info

i would expect it to be formatted :

Hi Joe,
freddie has Filled out the form on the Website,
The information from the form is listed below:
more info
more info

Does anyone have any idea why this happens ???
--
Chris,

Hmmm, I haven't seen this problem before, although I have used mail() a
fair amount.


i see it from time to time but havent been able to work out why
Some thoughts - first of all, what happens if you change the \t to a
couple of spaces? Does that change things?
i have tried it without the \t also without the commer

Also, what does the message's source look like? Is it possible your mail
reader is reformatting and you don't know it?

Finally - did you copy/paste the code, or did you retype it? If the
latter, did you accidentally correct your "problem" when retyping? :-)

But no - you do NOT want to insert html code into your message -
especially the header.
i thought about doing it in html but dont want to go down that road
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Apr 14 '06 #5
i have tried without the commer, and i am using outlook 2003
"fletch" <ri****************@googlemail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
I think it's something to do with the content-encoding. Don't throw in
html. It is obeying the rule for "more info" and not for the line
ending "website," which is odd, something to do with the comma?
(Clutching at straws!)

Could it be the email client you are using.

Also is the "From" working correctly? With qmail it only works when
it's like "From: jo*@doe.com\n"

Apr 14 '06 #6
chris wrote:
"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:tb******************************@comcast.com. ..
chris wrote:
My code
<?php
$name = "freddie";

$message.="Hi Joe,\n";
$message.="\t $name has Filled out the form on the Website,\n";
$message.="The information from the form is listed below:\n";
$message.="more info\n";
$message.="more info\n";

mail("email address", "subject",$message,"FROM:email address");
?>

when this is run the email recieved is formatted :
Hi Joe,
freddie has Filled out the form on the Website, The information
from
the form is listed below:
more info
more info

i would expect it to be formatted :

Hi Joe,
freddie has Filled out the form on the Website,
The information from the form is listed below:
more info
more info

Does anyone have any idea why this happens ???
--


Chris,

Hmmm, I haven't seen this problem before, although I have used mail() a
fair amount.

i see it from time to time but havent been able to work out why

Some thoughts - first of all, what happens if you change the \t to a
couple of spaces? Does that change things?

i have tried it without the \t also without the commer
Also, what does the message's source look like? Is it possible your mail
reader is reformatting and you don't know it?

Finally - did you copy/paste the code, or did you retype it? If the
latter, did you accidentally correct your "problem" when retyping? :-)

But no - you do NOT want to insert html code into your message -
especially the header.

i thought about doing it in html but dont want to go down that road

Chris,

Another thought. Before you send the message, write out everything - headers,
message, everything - to a database. Then when you get a bad message, go back
to the database to see what was actually sent to mail(). That should give you a
better idea of whether the problem is in your message itself or the mail command.

I'm just wondering if a spammer may be trying to add a BCC: field or something
similar to see if he can break your form.

Even if not - at least you'll see the raw data - maybe it will help.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 14 '06 #7

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

Similar topics

7
by: ilona | last post by:
Hi all, I store phone numbers in the database as 123447775665554(input mask is used for input, and some numbers have extensions), and I also know from db if the number is Canadian, US, or some...
3
by: Tim T | last post by:
Hi, I hope there is someone reading this that has the answer, Please Help! I have the need to send a html email via asp.net. its easy enough to send an html email and add attachments. My...
10
by: Coleen | last post by:
Hi all :-) I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML. Here is the snippet of code for the cell I'm trying to format: Dim...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
4
by: cybervigilante | last post by:
I sent HTML formatted email, using PHP, to my Yahoo address from my server, and it came out fine, styles and all. I sent it to my gmail address to test it and all I see is the raw html code. But I...
0
by: titia111 | last post by:
This is my second post. Can anyone help? I am using nested gridviews, and they are pulling the data correctly but I am having difficulty formatting the results. I need to insert a line break...
2
by: =?Utf-8?B?Q2FwdGFpbiBEYXZlIQ==?= | last post by:
I wrote some code to send an email with two alternate views: 1) html 2) plain text All the html enabled email clients accept the html just fine and disregard the plain text version. However,...
3
sanjay123456
by: sanjay123456 | last post by:
Dear friends, <?php //define the receiver of the email $to = 'sanjay.mit@gmail.com'; //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be...
2
by: robertng90025 | last post by:
I'm having a problem with MS Access 2003 and its conditional formatting. I have textboxes on a continuous form whose left and right margins are set to 0.03 inches. Based on each textbox's...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.