entreated Posted June 17, 2009 Share Posted June 17, 2009 <?php if(!empty($_POST)){ $to = "[email protected]"; $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 protected] for viewing. *note* Link to comment https://forums.phpfreaks.com/topic/162676-form-not-sending-email/ 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); Link to comment https://forums.phpfreaks.com/topic/162676-form-not-sending-email/#findComment-858505 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 Link to comment https://forums.phpfreaks.com/topic/162676-form-not-sending-email/#findComment-858508 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', '[email protected]'); 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. Link to comment https://forums.phpfreaks.com/topic/162676-form-not-sending-email/#findComment-858517 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.. Link to comment https://forums.phpfreaks.com/topic/162676-form-not-sending-email/#findComment-858521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.