Hello,
I am new to php coding. I have a simple contact form on my web site and I uploaded a php document to send the content from my web form to my email. I also created a web page to display after submission - thanking the users for their email.
Well, the thank you page loads after submitting the form - however no email is ever received. I do not get any error messages. it acts as if it is working, but no email is ever received.
Below is my php code. What am I doing wrong? My site is hosted at justhost.com.
Thank you very much for your help!
code:
[php]<?php
/* Subject and Email Variables*/
$emailSubject = 'Email from Rex Miller Design Web site!';
$webMaster = '[email protected]';
/* Gathering Data Variables/*
$emailField = $_POST['email'];
$nameField = $_POST['name'];
$purposeField = $_POST['purpose'];
$commentsField = $_POST['comments'];
$body = <<<EOD
Email: $email
Name: $name
Purpose: $purpose
Comments: $comments
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
THANK YOU
Thank you!
Thank you for your email.
I will respond as soon as possible!
EOD;
echo “$theResults”;
?>
[/php]