I’m using the following php script to email form information from a “Contact Us” page:
[php]
<?php /* Subject and Email Variables */ $emailSubject = 'ICGuru Contact Us submission'; $webMaster = '[email protected]'; /* Gathering Data Variables */ $emailField = $_POST['email']; $nameField = $_POST['name']; $phoneField = $_POST['phone']; $commentsField = $_POST['comments']; $body = <<<EODEmail: $emailField
Name: $nameField
Phone: $phoneField
Comments: $commentsField
EOD; $headers = "From: $emailField\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail ($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD **code of confirmation page omitted** EOD; echo "$theResults"; ?>
[/php]
When the user clicks on the submit button the confirmation page comes up, so the php script is running, but no email is sent.
The code looks good to me, but I’m very new at php. Could someone check out the code and let me know if there are any problems? If the code is good does that mean there is a problem with the server settings? Any recommendations on what might be set differently?
Thank you!