Hi there -
My partner and I are new to PHP and were very happy with the enquiry form we created yet it only works sometimes. It was brought to my attention when a prospective client called us after she submitted an enquiry and hadn't heard anything from us. Sometimes it works and sometimes you hit submit then the 'thank you for contacting us page' appears with 'function.mail' underlined and in blue in the top left hand corner - when this occurs we do not receive an email with the information. I cannot find anything that may be causing it. We have tried a number of different PCs, email addresses, operating systems etc... yet there does not seem to be any consistency to why it does or doesn't work. Please find the code below:
Any ideas/suggestions would be appreciated
Many Thanks
My partner and I are new to PHP and were very happy with the enquiry form we created yet it only works sometimes. It was brought to my attention when a prospective client called us after she submitted an enquiry and hadn't heard anything from us. Sometimes it works and sometimes you hit submit then the 'thank you for contacting us page' appears with 'function.mail' underlined and in blue in the top left hand corner - when this occurs we do not receive an email with the information. I cannot find anything that may be causing it. We have tried a number of different PCs, email addresses, operating systems etc... yet there does not seem to be any consistency to why it does or doesn't work. Please find the code below:
Code:
<?php /* Subject and Email Variables */ $emailSubject = 'PXP Enquiry'; $webMaster = 'webmaster@example.com'; /* Gathering Data Varibles */ $nameField = $_POST['name']; $emailField = $_POST['email']; $contactnoField = $_POST['contactno']; $eventdateField = $_POST['eventdate']; $eventtypeField = $_POST['eventtype']; $venueField = $_POST['venue']; $ultraField = $_POST['ultra']; $jamyField = $_POST['jamy']; $motownersField = $_POST['motowners']; $prestigeField = $_POST['prestige']; $fuzzField = $_POST['fuzz']; $qpField = $_POST['qp']; $pxField = $_POST['px']; $ck2Field = $_POST['ck2']; $howdidyoufindusField = $_POST['howdidyoufindus']; $addinfoField = $_POST['addinfo']; $newsletterField = $_POST['newsletter']; $body = <<<EOD <br><hr><br> Name: $nameField <br> Email: $emailField <br> Contact No: $contactnoField <br> Date of Event: $eventdateField <br> Type of Event: $eventtypeField <br> Venue Details: $venueField <br> Ultra: $ultraField <br> Jamy Winehouse: $jamyField <br> Motowners: $motownersField <br> Prestige: $prestigeField <br> Fuzz: $fuzzField <br> Quantum: $qpField <br> Project X: $pxField <br> CK2: $ck2Field <br> How Did You Find Us: $howdidyoufindusField <br> Additional Info/Requirements: $addinfoField <br> Newsletter: $newsletterField <br> EOD; $headers = "From: $emailField\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */
Many Thanks
Comment