php mail with sender
<p>In this mailform everything things work except there is no sender and my mail is going straight to the trash! is it because theres no sender on this mailform? And I want to se the information from the sender so a wonder where do I fill in the code from sender? </p>

<pre><code>&lt;?php
/* Set e-mail recipient */
$myemail = "xxxxx@live.com";

/* Check all form inputs using check_input function */
$name = check_input($_POST['inputName'], "Your Name");
$email = check_input($_POST['inputEmail'], "Your E-mail Address");
$subject = check_input($_POST['inputSubject'], "Message Subject");
$message = check_input($_POST['inputMessage'], "Your Message");

/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Invalid e-mail address");
}
/* Let's prepare the message for the e-mail */


$message = "

Someone has sent you a message from xxxxxxx.com:

Name: $name
Email: $email
Subject: $subject

Message:
$message

";

/* Send the message using mail() function */
mail($myemail, $subject, $message);

/* Redirect visitor to the thank you page */
header('Location: http://www.xxxxxxx.com/confirmation.html');
exit();

/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem &amp;&amp; strlen($data) == 0)
{
show_error($problem);
}
return $data;
}

function show_error($myError)
{
?&gt;
&lt;html&gt;

  &lt;body&gt;

    &lt;p&gt;Please correct the following error:&lt;/p&gt;
    &lt;strong&gt;&lt;?php echo $myError; ?&gt;&lt;/strong&gt;
    &lt;p&gt;Hit the back button and try again&lt;/p&gt;

  &lt;/body&gt;
&lt;/html&gt;
&lt;?php
exit();
}
?&gt;
</code></pre>