Hi,
I’m a newbie, too. I looked at your code as a learning exercise. There are many errors beyond the lack of a semicolon after your email address. You have multiple syntax errors and variable mismatches. I don’t understand the inclusion of ‘Field’ when declaring variables but it creates a mismatch when you later use the variable without including field.
I assume that you have a form to send the variables to your script. Since I didn’t have the form, I assigned values to the variables which you will not need to do when you use your form.
One thing that I do - remember I’m a newbie, too - is to use a lot of echo statements to make sure the script is actually doing what I want it to do.
I removed a few bits that I thought were surplussage.
This works on my local XAMPP, remember to remove the “//” before $success when you’re ready to start sending emails.
This is what I changed:
[php]
<?php
/* Subject and Email Variables */
$emailSubject = 'website inquiry';
$webMaster = '
[email protected]' ; // missing semicolon, as noted by darkfreaks
/* Gathering Data Variables */
// /* Field */ causes a variable mismatch
$name /* Field */ = $_POST['name'] = "post_name"; // remove assigned value after testing
$phone /* Field */ = $_POST['phone'] = "post_phone"; // remove assigned value after testing
$email /* Field */ = $_POST['email'] = "post_email"; // remove assigned value after testing
$inquiring /* Field */ = $_POST['inquiring about'] = "post_inquiry"; // remove assigned value after testing
$comments /* Field */ = $_POST['comments'] = "post_comments"; // remove assigned value after testing
$body = "
Name: " . $name . "
Phone: " . $phone . "
Email: " . $email . "
Inquiring About: " . $inquiring . "
Comments: " . $comments . "
";
echo "BODY IS: " . $body . "
" ; // echo for debugging; remove or comment-out for final working version
$headers = "From: $email\r\n\ ";
$headers .= "Content-type: text/html\r\n\ ";
// $success = mail($webMaster, $emailSubject, $body, $headers); // uncomment line when ready to actually send
/* Results rendered as HTML */
$theResults =
"
HSH thank you page
Thank you for your interest! Your email will be answered very soon!
";
echo "
TheRESULTS:
". $theResults ; // variable - with $ sign - not in original script
?>
[/php]
Good luck!