# PHP Email Form Not Working

**URL:** <https://forum.kirupa.com/t/php-email-form-not-working/220311>\
**Category:** programming\
**Created:** [March 25, 2007, 12:54am UTC](https://forum.kirupa.com/t/php-email-form-not-working/220311 "2007-03-25T00:54:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![htalwala](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@htalwala](https://forum.kirupa.com/u/htalwala)\
**Post date:** [March 25, 2007, 12:54am UTC](https://forum.kirupa.com/t/php-email-form-not-working/220311/1 "2007-03-25T00:54:04Z")

</div>

Below are the HTML and PHP files that I made for my email form. The form is not emailing me any response and I can not figure out why. Please help.

\<?PHP  
$to = "fastschedule@moureys.com";  
$subject = “Fast Schedule Form”;  
$headers = “From: My Site”;  
$forward = 1;  
$location = “[http://www.moureys.com](http://www.moureys.com)”;

$date = date (“l, F jS, Y”);  
$time = date (“h:i A”);

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.

";

if ($\_SERVER[‘REQUEST\_METHOD’] == “POST”) {  
foreach ($\_POST as $key =\> $value) {  
$msg .= ucfirst ($key) ." : ". $value . "  
“;  
}  
}  
else {  
foreach ($\_GET as $key =\> $value) {  
$msg .= ucfirst ($key) .” : ". $value . "  
";  
}  
}

mail($to, $subject, $msg, $headers);  
if ($forward == 1) {  
header (“Location:$location”);  
}  
else {  
echo “Thank you for submitting our form. We will get back to you as soon as possible.”;  
}

?\>

and the HTML Form goes like this…

\<form action=“mailer.php” method=“post”\>  
\<label\>  
\<input name=“name” type=“text” class=“FastSchedule” id=“name” size=“28” /\>  
\<input name=“address” type=“text” class=“FastSchedule” id=“address” size=“28” /\>  
\<input name=“city” type=“text” class=“FastSchedule” id=“city” size=“28” /\>  
\<select size=“1” name=“drop\_down” class=“FastSchedule”\>  
\<option\>CA\</option\>  
\</select\>  
\<input name=“zipcode” type=“text” class=“FastSchedule” id=“zipcode” size=“14” /\>  
\<input name=“phone” type=“text” class=“FastSchedule” id=“phone” size=“14” /\>  
\<input name=“email” type=“text” class=“FastSchedule” id=“email” size=“28” /\>  
\<span class=“FastSchedule”\>  
\<input type=“checkbox” name=“checkbox[]” value=“10am12pm” /\>  
10am-12pm\</span\> \<span class=“FastSchedule”\>  
\<input type=“checkbox” name=“checkbox[]” value=“1pm3pm” /\>  
1pm-3pm\</span\>  
\<span class=“FastSchedule”\>  
\<input type=“checkbox” name=“checkbox[]” value=“3pm5pm” /\>  
3pm-5pm\</span\>  
\<span class=“FastSchedule”\>  
\<input type=“checkbox” name=“checkbox[]” value=“6pm8pm” /\>  
6pm-8pm\</span\>  
\<input type=“submit” name=“Submit” value=“Submit” /\>  
\</label\>  
\</form\>
