jrws Posted April 30, 2012 Share Posted April 30, 2012 Hey guys, Coding something for a survey as no solution exists for our needs. I have not finished the code as I still need to do error checks + making it spam proof. Anyway I am not reciving the email even though it says that I have been sent it. Any suggestions are appreciated, please ask if you need additional info to be able to help, and thank you in advanced. <?php error_reporting(0); if(isset($_POST['submit'])){ //Check that all fields that are mandatory are filled in and that the $Email variable is real $Title = $_POST['Title']; $FirstName = $_POST['FirstName']; $LastName = $_POST['LastName']; $Email= $_POST['Email']; $Country= $_POST['Country']; $State= $_POST['State']; $List= $_POST['List']; $Nav= $_POST['Nav']; $IssuesYes= $_POST['IssuesCheck']; $IssuesList= $_POST['IssuesList']; $Satisfaction= $_POST['Satisfaction']; $Improvement= $_POST['Improvement']; $ValueSatisfaction= $_POST['Value']; $Recommendation= $_POST['Recommend']; $Knowledge= $_POST['Knowledge']; $Comments= $_POST['Comments']; $Gender= $_POST['Gender']; $Age= $_POST['Age']; $Source= $_POST['Source']; $ContactNumber= $_POST['Contact']; $Newsletter= $_POST['Newsletter']; $errors = array(); //Check that the fields above are not empty: $to = "email@email.com";//Obviously not real one that I am sending to. $subject = "Survey Form Submission"; $from = $to; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $body = "$name submitted the survey form:\n". "This is what they responded with to each question: <br>". "Their Name: $Title $FirstName $LastName <br>"."Email: $Email <br>"."Country: $Country <br>"."State: $State<br>"."Bought: $List<br>"."Website Navigation: $Nav<br>"."Issues: $IssuesYes " ." $IssuesList"."Satisfaction: $Satisfaction<br>"."Improvement: $Improvement<br>"."Value Satisfaction: $ValueSatisfaction<br>"."Reccomend: $Recommendation<br>"."Knowledge: $Knowledge<br>"."Comments: $Comments <br>"."Gender: $Gender<br>"."Age: $Age <br>"."Source for Finding Us: $Source <br>"."Contact: $ContactNumber<br>"."Subscribe to Newsletter?: $Newsletter<br>"; $headers = "From: $from \r\n"; $headers .= "Reply-To: $visitor_email \r\n"; if( mail($to, $subject, $body,$headers)){ echo "Email Send!"; }else{ echo "Somethings wrong :\ "; } // header('Location: http://www.********/thank-you-for-survey'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/261824-email-is-not-sending/ Share on other sites More sharing options...
iarp Posted April 30, 2012 Share Posted April 30, 2012 Where are you running the script? If it's a linux based machine with postfix it could potentially be in a queue system (postfix --flush I think). Also possible that the email system is setup to not accept emails from the domain for some reason. It sends just fine on my linux and windows based systems. Quote Link to comment https://forums.phpfreaks.com/topic/261824-email-is-not-sending/#findComment-1341622 Share on other sites More sharing options...
jrws Posted May 1, 2012 Author Share Posted May 1, 2012 I am running based off a godaddy server so whatever they use. I only recived my test emails today. Any idea why it could be so slow? At least I get them *eventually* :\ Quote Link to comment https://forums.phpfreaks.com/topic/261824-email-is-not-sending/#findComment-1341863 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.