I am trying to figure out why the contact form is not working anymore. But the code seems to be fine. This is the beginning of the code I added for the contact form.
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "test@test.com";
$email_subject = "Contact Form";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
And this is the last part of the code:
// create email headers
$headers = 'From:reply@test.com' . "\r\n" .
'Reply-To: '.$email_from. "\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
Any ideas what might be the problem here? Thank you!