submit button not sending the email ,php

Hello !
I’m working with a template script, with a contact form made in php and javascript. Everything looks good but when uploaded, and I test it. It will not send the email…

please help

Let me look into my crystal ball, nope still can’t see the problem. ;D

While everything might look good, doesn’t mean that it is. Show us the code and I am sure someone will help you.

I’m also having this issue. Trying to use the form template from http://www.freecontactform.com/email_form.php but not getting emails. I edited their code a little but not in a way that should make a difference I think. Maybe I’m wrong:

This is the code for my form which is in my index.html file:

[code]

request a free demo

Name: Email: Phone Number: Comments:
go!
[/code]

And here is my send_form_email.php:

[php]<?php
if(isset($_POST[‘Email’])) {

// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "[email protected]";
$email_subject = "A new conversion";
 
 
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();
}
 
// validation expected data exists
if(!isset($_POST['Name']) ||
    !isset($_POST['Email']) || {
    died('We are sorry, but there appears to be a problem with the form you submitted.');       
}
 
$name = $_POST['Name']; // required
$email_from = $_POST['Email']; // required
$telephone = $_POST['Phone Number'];
$comments = $_POST['Comments']; 
 
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';

if(!preg_match($email_exp,$email_from)) {
$error_message .= ‘The Email Address you entered does not appear to be valid.
’;
}
$string_exp = “/^[A-Za-z .’-]+$/”;
if(!preg_match($string_exp,$name)) {
$error_message .= ‘The name you entered does not appear to be valid.
’;
}

if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = “Form details below.\n\n”;

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}

$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Phone Number: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";

// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
‘X-Mailer: PHP/’ . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);

?>

Thank you for contacting us. We will be in touch with you very soon.

<?php } ?>[/php]

When the submit is clicked on my form, it goes to the confirmation page, but I never get an email. None of the validation seems to be done either since I don’t see any errors for not filling out fields. Is there some other step I may have missed when uploading the files? Do I have to install anything?

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service