entreated Posted June 17, 2009 Share Posted June 17, 2009 <?php if(!empty($_POST)){ $to = "email@email.com"; $subject = "Precison Ceramics Questionnaire"; $name = ($_POST["name"]); $email = ($_POST["email"]); $first_impressions = ($_POST["first_impressions"]); $layout = ($_POST["layout"]); $navigation = ($_POST["navigation"]); $general_improvements = ($_POST["general_improvements"]); $ip = $_SERVER['REMOTE_ADDR']; $body = "From: $name \n Email: $email \n First Impressions: $first_impressions \n Layout: $layout \n Ease of navigation: $navigation \n General improvements: $general_improvements \n Ip: $ip"; if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))) { die ("Invalid Email Address"); } if(empty($first_impressions) || empty($layout) || empty($navigation) || empty($general_improvements)) { die ("You didn't fill in all the fields"); } mail($to $subject, $body); header("Location: thanks.html"); exit; } ?> All errors work and it goes to the thanks page but just doesn't send an email.. *note* I have taken the real email address out and replaced with 'email@email.com for viewing. *note* Quote Link to comment Share on other sites More sharing options...
sailorsmokey Posted June 17, 2009 Share Posted June 17, 2009 Hi, Looks like you are missing a comma here, which I think might make a difference: mail($to, $subject, $body); Quote Link to comment Share on other sites More sharing options...
entreated Posted June 17, 2009 Author Share Posted June 17, 2009 I've just typed '$to' in there because i tried it with my email but still didn't work Quote Link to comment Share on other sites More sharing options...
sailorsmokey Posted June 17, 2009 Share Posted June 17, 2009 On php.net, someone said they added the following to their code: ini_set('sendmail_from', 'me@domain.com'); mail($to $subject, $body); I do remember setting something up on my server, but it's been years since I originally coded my email scripts, and I just don't remember what else I set up. Quote Link to comment Share on other sites More sharing options...
entreated Posted June 17, 2009 Author Share Posted June 17, 2009 Okay it was just some stupid mistake.. It was going to my spam mail.. I can't believe it ahah, stupid me.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.