dazzclub Posted May 23, 2008 Share Posted May 23, 2008 Hi there, I have this php contact form that I created a while ago...with three emails in the "To..." section and i have noticed that on one particluar email, i dont recieve it. My question is...what approach would you take on solving this... My first approach was to test the form again my simply completing it and then submitting it.....I recieved the form I then inserted another email that the form will be sent to..........I recieved the form I then directly emailed the particular email that fails to recieve it...and that email got through I looked at the script i have failed to spot anything. Here is the code...if you guys manage to spot it. <?php $EmailFrom = "My contact form"; $EmailTo = "dazzathotmail.com, darren.azzopardiathotmail.co.uk, dazzclubatyahoo.co.uk"; $Subject = "Enquiry/Comments"; $FullName = Trim(stripslashes($_POST['FullName'])); $Address1 = Trim(stripslashes($_POST['Address1'])); $Address2 = Trim(stripslashes($_POST['Address2'])); $Address3 = Trim(stripslashes($_POST['Address3'])); $Postcode = Trim(stripslashes($_POST['Postcode'])); $Email = Trim(stripslashes($_POST['Email'])); $telephone = Trim(stripslashes($_POST['telephone'])); $city = Trim(stripslashes($_POST['city'])); // $country = Trim(stripslashes($_POST['country'])); // $OnetoFourTimesPerYear = Trim(stripslashes($_POST['OnetoFourTimesPerYear'])); $FiveToTenTimesPerYear = Trim(stripslashes($_POST['FiveToTenTimesPerYear'])); $ElevenPlusTimesPerYear = Trim(stripslashes($_POST['ElevenPlusTimesPerYear'])); // $YesTrip = Trim(stripslashes($_POST['YesTrip'])); $NoTrip = Trim(stripslashes($_POST['NoTrip'])); // $YesFutureEvents = Trim(stripslashes($_POST['YesFutureEvents'])); $NoFutureEvents = Trim(stripslashes($_POST['NoFutureEvents'])); // $LiverpoolDailyPost = Trim(stripslashes($_POST['LiverpoolDailyPost'])); $MailShot = Trim(stripslashes($_POST['MailShot'])); $Advert = Trim(stripslashes($_POST['Advert'])); $Website = Trim(stripslashes($_POST['Website'])); $Touristboard = Trim(stripslashes($_POST['Touristboard'])); $Other = Trim(stripslashes($_POST['Other'])); $IfOther = Trim(stripslashes($_POST['IfOther'])); // $otherAttractionsA = Trim(stripslashes($_POST['otherAttractionsA'])); $otherAttractionsB = Trim(stripslashes($_POST['otherAttractionsB'])); $otherAttractionsC = Trim(stripslashes($_POST['otherAttractionsC'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error/\">"; exit; } // prepare email body text # prepare email body text $Body .= " Contact Form: "; $Body .= "\n"; $Body .= "\n"; $Body .= "FullName: "; $Body .= $FullName; $Body .= "\n"; $Body .= "\n"; $Body .= "Address1: "; $Body .= $Address1; $Body .= "\n"; $Body .= "\n"; $Body .= "Address2: "; $Body .= $Address2; $Body .= "\n"; $Body .= "\n"; $Body .= "Address3: "; $Body .= $Address3; $Body .= "\n"; $Body .= "\n"; $Body .= "Postcode: "; $Body .= $Postcode; $Body .= "\n"; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "\n"; $Body .= "How often do you visit us?: "; $Body .= "\n"; $Body .= "\n"; $Body .= $OnetoFourTimesPerYear; $Body .= "\n"; $Body .= "\n"; $Body .= $FiveToTenTimesPerYear; $Body .= "\n"; $Body .= $ElevenPlusTimesPerYear; $Body .= "\n"; $Body .= "\n"; $Body .= "Do you visit as part of trip?: "; $Body .= "\n"; $Body .= "\n"; $Body .= $YesTrip; $Body .= "\n"; $Body .= "\n"; $Body .= $NoTrip; $Body .= "\n"; $Body .= "\n"; $Body .= "Would you like us to inform you of future events?: "; $Body .= "\n"; $Body .= "\n"; $Body .= $YesFutureEvents; $Body .= "\n"; $Body .= "\n"; $Body .= $NoFutureEvents; $Body .= "\n"; $Body .= "\n"; $Body .= "How did you hear about us?: "; $Body .= "\n"; $Body .= "\n"; $Body .= $LiverpoolDailyPost; $Body .= "\n"; $Body .= "\n"; $Body .= $MailShot; $Body .= "\n"; $Body .= "\n"; $Body .= $Advert; $Body .= "\n"; $Body .= "\n"; $Body .= $Website; $Body .= "\n"; $Body .= "\n"; $Body .= $Touristboard; $Body .= "\n"; $Body .= "\n"; $Body .= $Other; $Body .= "\n"; $Body .= "\n"; $Body .= $IfOther; $Body .= "\n"; $Body .= "\n"; $Body .= "What other attractions do you visit in the area?: "; $Body .= "\n"; $Body .= "\n"; $Body .= $otherAttractionsA; $Body .= "\n"; $Body .= "\n"; $Body .= $otherAttractionsB; $Body .= "\n"; $Body .= "\n"; $Body .= $otherAttractionsC; $Body .= "\n"; $Body .= "\n"; /////////////// // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=sent/\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error/\">"; } ?> If anyone finds anything that would be great...my next step will be to contact the host...see what php version they have....i dont know if that will solve anything but its another thing to look at or rule out.. cheers Dazz Link to comment https://forums.phpfreaks.com/topic/106940-email-query/ Share on other sites More sharing options...
haku Posted May 23, 2008 Share Posted May 23, 2008 Many email servers filter email that has been sent with the mail() function. Download a mail class (I use phpmailer myself) and try that, and it should solve your problems. There is a good tutorial on their site to figure out how it works. Link to comment https://forums.phpfreaks.com/topic/106940-email-query/#findComment-548100 Share on other sites More sharing options...
dazzclub Posted May 23, 2008 Author Share Posted May 23, 2008 Hi there, your right on that....I may need to look into that.....thanks for the heads up. Cheers Dazzclub Link to comment https://forums.phpfreaks.com/topic/106940-email-query/#findComment-548147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.