you have to send some mail headers in order for the mail server to know what the return address is, here is some code to help you out!
all these vars are passed from a form on my site so..
$myname = the persons name
$myemail = the persons email address
$mybody = is the body of the messge
i have a fucntion call CheckStr to make sure that the user is not try to send information i don't want Ie: a Cross-Site Scripting Attack.
//ok so if the strings are all ok returns true
if (CheckStr($myname) == false && CheckStr($myemail) == false && CheckStr($mybody) == false)
{
//my return address is below as you can see i have a var called $header, you can also add the line "Reply-to: persons@email.address so when you press reply on your MTA, it will reply to that persons email, i just put it in the body of the message
$MyHeader = "From: onlinecomments@bidspyder.com\n";
$MyMsg = $MyMsg . "Name: " . $myname . "\n";
$MyMsg = $MyMsg . "Return Email Address: " . $myemail . "\n\n";
$MyMsg = $MyMsg . "Comments: " . $mybody . "\n";
//send the message
mail("comments@bidspyder.com",$MyMsg,$MyHeader);
}
else
{
$MyMsg = "Sorry your message contained invaild characters!";
}
?>
done and done.!