$recipient = $_POST['to'];
$subject = $_POST['subject'];
$message = "{$_POST['message']}";
$headers = 'From: ' . $_POST['from'] . "\r\n"
.'Reply-To: ' . $_POST['from'] . "\r\n";
if (mail($recipient, $subject, $message, $headers)) {
echo 'Mail Sent';
} else {
echo 'Mail NOT Sent';}
dont worry im not setting up a site for spam mailers, i was just messing about with the mail() function for educational purposes but have come across a problem. no matter what i do, the reply-to header is never set. as you can see, the reply to should be the same as the from header but for some reason this is not hapenning. i have tried it inside double quotes, with and without braces, with its own $POST array but nothing works apart from when i type the literal string into the php itself.
ie.
$headers = 'From: ' . $_POST['from'] . "\r\n"
.'Reply-To: me@mysite.com' . "\r\n";
any ideas?