Can somebody help me sort this out.When I receive emails via my contact page using the script below.On the email it says from "Nobody [nobody@pro.host-care.com]" Off course in the email body it gives me the email adress that has been filled in.But it would be great to actually have the email address that the person is sending the email from.
Here is the script below.
<?php
session_start();
if( $_SESSION['6_letters_code'] == $_POST['6_letters_code'] && !empty($_SESSION['6_letters_code'] ) ) {
$to = "example@example.com";
$email_subject = "This is the email subject";
$name = $_POST['name']. "\n";
$telephone = $_POST['telephone']. "\n";
$email = $_POST['email']. "\n";
$message = $_POST['message']. "\n";
$email_body = "Troy you have received a New Message/Inquiry from"
. $name
. $telephone
. $email
. $message; ". Here is the Message/Inquiry: ";
mail($to, $email_subject, $email_body);
ob_start(); echo "Test"; header("Location: http://mysite.com/thanks.html"); ob_flush();
} else {
ob_start(); echo "Test"; header("Location: http://mysite.com/error.html"); ob_flush();
}
?>