473,769 Members | 7,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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",$mess age,"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 1601
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",$mess age,"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",$mess age,"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*******@attgl obal.net
=============== ===
Apr 14 '06 #4
"Jerry Stuckle" <js*******@attg lobal.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",$mess age,"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*******@attgl obal.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.goo glegroups.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*******@attg lobal.net> wrote in message
news:tb******** *************** *******@comcast .com...
chris wrote:
My code
<?php
$name = "freddie";

$message.="H i Joe,\n";
$message.="\ t $name has Filled out the form on the Website,\n";
$message.="T he information from the form is listed below:\n";
$message.="m ore info\n";
$message.="m ore info\n";

mail("emai l address", "subject",$mess age,"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*******@attgl obal.net
=============== ===
Apr 14 '06 #7

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

Similar topics

7
398
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 other country. When I retrieve the phone numbers, I need to display them as (###) ###-#### x 99999 if it is a Canadian number or (###) ###-#### Ext. 99999 if it is US phone number. Potentially I'd have other countries added as well which might have...
3
5688
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 question is, how to you set the Content-Location of each attachment in the mail headers so that the images are embedded in the html email rather than attached? This is my code:
10
3163
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 ld_tot_pet_clean_fee_calc As Double ld_tot_pet_clean_fee_calc = li_net_total_calc * 0.0075 ld_tot_pet_clean_fee = lo_misc_func.FormatMC(ld_tot_pet_clean_fee_calc, "D") Session("tot_pet_clean_fee") = lo_misc_func.FormatMC(ld_tot_pet_clean_fee, "D")...
8
9180
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 custom format and a IFormatProvider. I pass a custom format string for positive, negative and Zero (3 sections) and CultureInfo object containing the required DigitGrouping as IFormatProvider. But ToString is not formatting the value using the digit...
4
5068
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 do get formatted email in gmail, so I know people make it work somehow. I'm looking right at a gmail message that I copied to Dreamweaver and it's using Strong and Red text attributes that work in gmail. But mine don't. What do you do...
0
1053
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 after the first gridview, and between one of the fields in the second. This seems like a simple request, yet I am not finding any info on how to do this. Can it be done, and if not what other method would be better?
2
8815
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, the plain-text-only email clients I've tried keep reading my plain text email and formatting it in all kinds of crazy ways.
3
1964
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 unique
2
3315
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 current value, I set its background color. No problem with this part. My problem is that when clicking different text boxes representing the records on the continuous form, the left and the right margin areas do not always take on the background...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.