It return also 'Field Value' in first row. How to remove it? Where to add colon to field value?
Field Value
Name TESTER
email abcdef@yahoo.com
phone 85678889499
comments test test test test test test
Main Topics
Browse All TopicsThe feedback form I use send email in text format; problem is that mail message is not formatted/aligned, so it looks not too accurate in email.
Name: Jonatan
email: sample@yahoo.com
phone: 123456789
comments: text text text
I would like to add a simple formatting, to make it look more accurate.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
its all here
$body ="<table><tr><td>Field</td><td>Value
fo
{
if($field!="submit") $body .="<tr><td>$field</td><td>$value</t
}
$bo
to learn more about html tables : http://www.w3schools.com/h
I now this, not clear what is purpose values in first row::
$body ="<table><tr><td>Field</td><td>Value
Does this mean table header, or I can remove "Field" and "Value" from first row to keep it empty?(since I dont need table name/header)
Also, I see mail message source contain no html tags, do we need add it for html standard compliance?
<html>
<body>
</body>
</html>
Or this added by sending correct headers in mail message?
No i added the header table so you can know which column is the field and which one is the value you can delete that and leave only $body ="<table>";
Yes you could also add the html tags, the mail() function will not add those automaticaly
So the function should look like this with correct html structure
does it make sence specify html tags separately like Apache do?
function draw_success(){
$body = "<html>";
$body .= "<head>";
$body .= "<title></title>";
$body .= "</head>";
$body .= "<body>";
$body .= "<table>";
foreach($_POST as $field=>$value)
{
if($field!="submit") $body .="<tr><td>$field</td><td>$value</t
}
$body .= "</table>";
$body .= "</body>";
$body .= "</html>";
$h = "MIME-Version: 1.0\r\n";
$h .= "Content-type: text/html; charset=iso-8859-1\r\n";
$h .= "From: myemail@domain.com\r\n";
if(mail ("info@website.com",'from WEBsite sample.com', $body, $h))
return 'Thank You!';
}
Business Accounts
Answer for Membership
by: al3cs12Posted on 2009-02-26 at 08:00:40ID: 23746050
format it using tables in html, but to send html mail you need to send the correct headers, see below modified function
Select allOpen in new window