// Determine if a value of 'send' has been assigned to the key
// of 'action' in the query string. Remember that keys and values
// from forms and querystrings and cookies are automatically assigned
// to variables in PHP. Variables always start with a dollar sign.
if($action == "send"){
// We're going to create a few variables here, which will be self-descriptive
$to_address = "scott@superiorwoodworkinggc.com";
$subject = "An e-mail from Superior Woodworking";
// Create a variable for the body of the message based on the fields in the form
$body = "";
$body .= "First Name: " . $firstName . "\n";
$body .= "Last Name: " . $lastName . "\n";
$body .= "E-Mail Address: " . $eMail . "\n";
$body .= "Phone: " . $phone . "\n";
$body .= "Where are you located? " . $location . "\n";
$body .= "Comments:" . $comments . "\n";
// Finally, this is the simplest way to send an e-mail.
// You can go so far as attach files and utilize CCs and BCCs.
mail($to_address, $subject, $body);
// Redirects the client to whatever page is next, like a confirmation page.
// In this case, it just redirects back to itself.
header("Location: contact_message.html");
}
?>
Superior Woodworking & General Contracting
We would love to hear from you, and would be happy to answer any questions.
If you would like to speak to someone right away, you may call 248.996.0550.
Thank you!