Along time ago i required help on a script to send an e-mail to people filling out a form from a website.
Now i'm needing to use the same script, but changed and to send not only an e-mail to the person in charge of the site, but one straight back to the submitter for a thank you e-mail.
Heres my php script which i thought would of worked but doesn't.
<html>
<head>
<title></title>
</head>
<body bgcolor="#333333" text="white" link="white" alink="white" vlink="white">
<font size="1"><font face="Arial Narrow">
<?
if (!empty($POST['name']) || !empty($POST['email']) || !empty($POST['address']) || !empty($POST['city']) || !empty($_POST['state']) ||
!empty($POST['zip']) || !empty($POST['message']))
{
$to = "cameron@ingallsphotography.com";
$subject = "Ingalls Photography";
$msg = "Name: " . $name . "\n";
$msg .= "E-mail: " . $email . "\n";
$msg .= "Address: " . $address . "\n";
$msg .= "City: " . $city . "\n";
$msg .= "State: " . $state . "\n";
$msg .= "Zip Code: " . $zip . "\n";
$msg .= "Message: " . $message . "\n";
$headers = "From: $email";
mail($to, $subject, $msg, $headers);
echo "<Br><bR><br><B>Thank you for your interest in Ingalls Photography.
Cameron Ingalls has successfully recieved the e-mail and shall reply as soon
as possible. </b><Br><br>";
) else (
echo "Sorry but there seemed to be a problem. Please try again"
)
Here is where i thought i could add the following but doesn't work
$to = "$email";
$subject = "Ingalls Photography Submission";
$msg = "Thank you for visitng Ingalls Photography. This is a conformation
e-mail that has been sent to you for recently filling out the contacts form.<Br>br>
Mr.Ingalls is very busy with photography work such as weddings and family
photos. He shall reply as soon as he can.<Br><Br>
Thank you again<br><br>
Ingalls Photography team";
$headers = "From: Ingalls Photography";
}
mail($to, $subject, $msg, $headers);
?>
<br><Br>
You may return by the back button below...<br><br>
<a href="http://www.ingallsphotography.com/contact.htm">Back</a>
</body>
</html>
The second part is the part that needs to be sent to the submitter but it doesn't. I dont know how to get this to work. If someone could help please tell me what i'm doing wrong.