Hi i i have a form that is processed by the following php script - the form and script work fine (i got it off about.com works very well!!) but the client does not like the way the email arrives and wants some formatting could anyone tell me how i can do this through the php or any other means?

Regards

Steve Goodwin

The php file :

<?php

$to = $_REQUEST ;
$from = $_REQUEST ;
$name = $_REQUEST ;
$headers = "From: $from";
$subject = "Web Contact Data";


$fields = array();
$fields{"event"} = "Event";
$fields{"site"} = "site";
$fields{"name"} = "name";
$fields{"email"} = "email";
$fields{"phone"} = "phone";
$fields{"people"} = "people";
$fields{"orderdate"} ="orderdate";
$fields{"comments"} = "comments";

$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }

if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);

if($send)
{header( "Location: http://www.*********.com" );}
else
{print "We encountered an error sending your mail, please phone + 353 1 ******** for further information"; }
}
}
?>

Recommended Answers

All 2 Replies

You can create a nice looking conformation e-mail by using tables ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.