Hi everybody I really need some help so if someone out there knows how to do this please respond.
I have a form that looks like this:
<form action="mailForm.php" method="post">
<input type="hidden" value="john@email.com" name="recipient" />
<!-- Replace email address with the address you want the email sent to -->
<input type="hidden" value="contactResult.html" name="redirect" />
<table width="625" border="0" align="center">
<tr>
<td width="347">Company Name:<span style="color:red">*</span><br />
<input type="text" name="company" class="input" /></td>
<td width="262">Target Audience:<span style="color:red">*</span><br />
<input type="text" name="audience" class="input" /></td>
</tr>
<tr>
<td colspan="2"><br />
Description of Business:<span style="color:red">*</span><br />
<textarea rows="5" cols="50" name="description"></textarea></td>
</tr>
<tr>
<td><br />
Full Name:<span style="color:red">*</span><br />
<input type="text" name="name" class="input" /></td>
<td><br />
Email:<span style="color:red">*</span><br />
<input type="text" name="email" class="input" /></td>
</tr>
</table>
</form>
the whole mailForm.php file looks like this:
<?php
//grab the server time
$current_time = strftime("Request was sent on %B %d, at %H:%M%p ");
//get company info
$companyName = "Biz-plete";
$companyEmail = "no-reply@bizplete.com";
//fetch user post vars
foreach( $_POST as $key => $val)
{
$$key = $val;
}
//build mail
$to = $_POST['recipient'];
$subject = $companyName . " Form Submission!";
$msg =
"This is an automated message sent from the " . $companyName . " web site." . "\n\n" .
$current_time . "\n" .
"\n" .
"The following information was submitted: " . "\n" .
"------------START-------------" . "\n" .
"\n" .
"Company:" . $company . "\n" .
"\n" .
"Taget Audience:" . $audience . "\n" .
"\n" .
"Description of Business:" . $description . "\n" .
"\n" .
"Full Name:" . $name . "\n" .
"\n" .
"Email:" . $email . "\n" .
"\n" .
"---------------END--------------------" . "\n";
//send mail
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$companyName."\" <".$companyEmail.">\n";
mail("$to", stripslashes($subject), stripslashes($msg), $headers) or die("Could not send e-mail - Error A46GY7");
//send the user to the response page
$redirect = "Location: " . $_POST['redirect'];
header($redirect);
?>
My question is how would i send an auto responder when someone fills their email in the appropriate field in the form????
Does that make sense? PLEASE HELP!