Email Not Sending

I have a contact form on a webpage.  Whenever I try to send from the page, it says that its been sent but it doesn't show up in my inbox.  Somethings wrong!  Here is the page.

http://www.schuremediagroup.com/index.html#!/page_Contact

Any help is appreciated.  Thank you.
DS928Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Where is your php, we cannot debug from an html page
0
DS928Author Commented:
Woops!  Here it is.
send-form-email.php
0
Ray PaseurCommented:
Please use the code snippet feature to post code here at EE.  It gives us line numbers and a unispace font.  Plus it's immediately visible without having to do downloads.

<?php
if(isset($_POST['email'])) {
	// EDIT THE 2 LINES BELOW AS REQUIRED
     $email_to = "ds@schuremediagroup.com";
	 $email_subject = "Your email subject line";
	 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']) ||
	 !isset($_POST['comments'])) {
		         died('We are sorry, but there appears to be a problem with the form you submitted.');           }         			
				 $subject = $_POST['subject'];
				 $name = $_POST['name']; // required
				 $email_from = $_POST['email']; // required
				 $comments = $_POST['comments']; // required
				 $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.<br />';  }
					 $string_exp = "/^[A-Za-z .'-]+$/";  if(!preg_match($string_exp,$name)) {
						    }
							 if(strlen($comments) < 2) {
								 $error_message .= 'The Comments you entered do not appear to be valid.<br />';  }
								 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 .= "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);  ?>
                                         <!-- include your own success html here -->
                                        <div>
                                         Thank you for contacting us. We will be in touch with you very soon.
                                         </div>
                                         <?php
                                         }
										 ?>

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

GaryCommented:
What version of PHP are you using?
Amend this line slightly by removing the @ and see if you get any errors.
@mail($email_to, $email_subject, $email_message, $headers);
0
Ray PaseurCommented:
I would check the spam filters or whitelist the sending address.  The addition of extra headers may be enough to trip the filters and cause your mail server to discard the messages.  The use of the X-Mailer header with PHP information is a signature of spammers.

You might want to learn about ConstantContact.  It's easier and more dependable than sending your own email.  But if you're determined to do this stuff yourself, please get a foundation in how PHP works.  This article can steer you toward good learning resources and away from all the mountains of very, very bad PHP code that litters the internet.  If you're smart about it you will use the examples in the books recommended here, and never go to the internet for untested code again!
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0
DS928Author Commented:
I removed it and I got this error.
Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/d/s/t/dstr3/html/SMG/send_form_email.php on line 41

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

I am not sure what version of PHP I am using.  Where would I find that?
Thank you.
0
GaryCommented:
Amend your $header so it is just
$headers = 'From: '.$email_from;

Depending on your php version this maybe a problem - phpversion
If you create a page with just this in it
<?php
phpinfo();
?>

Open in new window

Execute it on the server and it will give you the version
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DS928Author Commented:
I am using version  5.2.17  Its working now,  Thank you.
0
GaryCommented:
phpversion is only available from v5.2.7+
0
DS928Author Commented:
PHP Version 5.2.17  This is what I copied.  How do you select the version that you want to use?
0
GaryCommented:
You can't, you have to update it, which if you are on shared hosting is upto your host.
0
DS928Author Commented:
Thank you.  I guess it's up to GoDaddy!
0
Ray PaseurCommented:
Another "happy" GoDaddy customer.  When will people learn!?
0
GaryCommented:
Never
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.