C
cybercop
Guest
Could anyone tell me please where i've made a mistake here in this php coding? When i fill the form in and hit the submit button it does show the $theResults but email doesn't get sent to my address. I've been trying to find out where the problem is but i'm not getting anywhere. I have contacted my server and they support mail().
<?php
$subject = "test";
$to = "[email protected]";
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$inquiryField = $_POST['inquiry'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Inquiry: $inquiryField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
/* Results rendered in Html */
$theResults = "email has been sent";
mail($to,$subject,$body,$headers);
echo "$theResults";
?>
<?php
$subject = "test";
$to = "[email protected]";
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$inquiryField = $_POST['inquiry'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Inquiry: $inquiryField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
/* Results rendered in Html */
$theResults = "email has been sent";
mail($to,$subject,$body,$headers);
echo "$theResults";
?>