Jump to content

email query


dazzclub

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.