Simple, (copied piece of own) code now not working - why?

I’ve stared at this simple code, which is pretty much identical to another piece of working code I have, for 2 days - I just cannot work out why it’s not working - I’m not receiving the email. Please help?!

[HTML]

Fizz Web Design- referral form


Your Name*
Your Email*
Confirm Your Email
Telephone Number
Please give us some information on the person/company being referred

Person/Company Name*
Which of the following is of interest?

Web Design Logo Design

Other (please add comments)

Please add some further information on who you are referring to us below:


Where did you hear about us?

Choose Option Google Other Search Engine Facebook Facebook Advertisement Online Advertisement Card/Flyer or Print Advertisement Word of Mouth Other (please state in comments)
I have read and agree to the specified terms & conditions:

Agree*
[/HTML]

[php]

<?php if(isset($_POST['submit'])) { $name = $_POST['name']; // required $telephone_number = $_POST['telephonenumber']; // required $email_address = $_POST['emailaddress']; // required $email_address_confirm = $_POST['emailaddressconfirm']; // required $person_or_company = $_POST['personorcompany']; // required //A: 1st field corresponds to last field of C (below) - 2nd fields are html names $comments = $_POST['comments']; // required $interest = $_POST['interest']; // required $how_find = $_POST['source']; $terms_agreed = $_POST['termsagreed']; // required if(!isset($_POST['name']) || $_POST['name']=='' || !isset($_POST['telephonenumber']) || $_POST['telephonenumber']=='' || // correspond to html names - these are the required fields !isset($_POST['emailaddress']) || $_POST['emailaddress']=='' || !isset($_POST['emailaddressconfirm']) || $_POST['emailaddressconfirm']=='' || !isset($_POST['personorcompanyname']) || $_POST['personorcompanyname']=='' || !isset($_POST['interest']) || $_POST['interest']=='' || !isset($_POST['comments']) || $_POST['comments']=='' || !isset($_POST['termsagreed']) || $_POST['termsagreed']==''){ die('You have not filled in all of the required fields - please hit your back button and try again!'); } else{ $email_to = "[email protected]"; $email_subject = "Referral from Fizz Web Design"; $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 or Company Name: ".clean_string($name)."\n"; $email_message .= "Telephone Number: ".clean_string($telephone_number)."\n"; $email_message .= "Email Address: ".clean_string($email_address)."\n"; $email_message .= "Confirm Email Address: ".clean_string($email_address_confirm)."\n"; // C: correspond to 1st part of A - this is the email you receive $email_message .= "Person or Company: ".clean_string($person_or_company)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; $email_message .= "What are they interested in?: ".clean_string($interest)."\n"; $email_message .= "How did you hear about us?: ".clean_string($how_find)."\n"; $email_message .= "Terms Agreed?: ".clean_string($terms_agreed)."\n"; // create email headers $headers = 'From: Fizz Web Design'. //'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); } } ?>

[/php]

Rectified, thx.

Sponsor our Newsletter | Privacy Policy | Terms of Service