I have a php file that sends eMail. How do I format the contents. Sample of what is sent now:
We have received the following information from a Survey:
Name: Robert Beyerlein
Email: topcat@vettenut.com
Phone: 123-445-7890
Did you the service you received satisfy you?: yes Were you satisfied with the quality of service?: yes Was the Brandenburg Auto Clinic web site easy to navigate?: yes Would you reccommend Brandenburg Auto Clinic to other people?: yes
Comments: My Comments
I would like to have each question/answer on a seperate line. Thank you in advance.
Current code:
<?php
///// cssend.php /////
if (!ini_get('display_errors')) {
ini_set('display_errors', 1);
}
ini_set('error_reporting', 'E_ALL & ~E_NOTICE');
$youremail = "acdelco40108@yahoo.com"; /*put the email address here, between quotes,
the email address you want the message sent to*/
$to = $youremail;
$email = $_POST['cust_email'];
$name = $_POST['cust_name'];
$phone = $_POST['cust_phone'];
$service_satisfy = $_POST['service_satisfy'];
$quality_satisfy = $_POST['quality_satisfy'];
$website_navigate = $_POST['website_navigate'];
$reccomend = $_POST['reccomend'];
$comments = $_POST['comments'];
$headers = "From:" . $email;
$fields = array();
$fields{"cust_name"} = "Name";
$fields{"cust_email"} = "Email";
$fields{"cust_phone"} = "Phone";
$fields{"service_satisfy"} = "Did you the service you received satisfy you?";
$fields{"quality_satisfy"} = "Were you satisfied with the quality of service?";
$fields{"website_navigate"} = "Was the Brandenburg Auto Clinic web site easy to navigate?";
$fields{"reccomend"} = "Would you reccommend Brandenburg Auto Clinic to other people?";
$fields{"comments"} = "Comments";
$subject = "We have received the following information from a Survey";
$body = "We have received the following information from a Survey:\n\n";
foreach($fields as $a => $b)
{ $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); }
mail ($to, $subject, $body, $headers); //send mail to owner
#end create email vars
$headers = "From:" . $to;
mail ($email, $subject, $body, $headers); //send mail to user
#end create email vars
echo "<head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2;
URL=ThankYou2.html\"></head>";
?>

