Beginner_php contact from not working

My contact form is not sending email. Please help!?
I am new to the whole php thing. I recently created a contact form following a few tutorials. I followed them and did exactly as the presenter told me to do. When I test the form, I get the success confirmation, but the actual email from is not sent to the webmaster specified. Can someone take a look at my code and let me know where I went wrong?

<?php /*Subject and email Variavbles */ $emailSubject = 'Ask a Designer Question'; $webMaster = '[email protected]'; /* Gathering Data Variables */ $emailField = $_POST['email']; $fnameField = $_POST['fname']; $lnameField = $_POST['lname']; $interestField = $_POST['interest']; $commentsField = $_POST['comments']; $newsletterField = $_POST['newsletter']; $body = <<<EOD


Email: $email
First Name: $fname
Last Name: $lname
Interest: $interest
Comments: $comments
Newsletter: $newsletter
EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD Ask a Designer Confirmation Page



Thank you for your interest! Your email will be answered by one of our designers very soon!



EOD; echo "$theResults"; ?>

these variables here:
[php]$emailField = $_POST[‘email’];
$fnameField = $_POST[‘fname’];
$lnameField = $_POST[‘lname’];
$interestField = $_POST[‘interest’];
$commentsField = $_POST[‘comments’];
$newsletterField = $_POST[‘newsletter’];
[/php]

are not the same as here:
[php]$body = <<<EOD




Email: $email

First Name: $fname

Last Name: $lname

Interest: $interest

Comments: $comments

Newsletter: $newsletter

EOD;
[/php]

and you have the from email variable as $email but i can’t see where $email is set in the script??
[php]$headers = “From: $email\r\n”;
$headers .= “Content-type: text/html\r\n”;
$success = mail($webMaster, $emailSubject, $body, $headers);[/php]

I take it these come from another script?
i did try your script (obviously changing the variables to my own email address) and it works just fine.

Sponsor our Newsletter | Privacy Policy | Terms of Service