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"; }
}
}
?>

This article has been dead for over six months. Start a new discussion instead.