This is my first time trying to create a php forum. Let's say I have a first user that posts a subject and enters his email address.
<form action="whatever.php" method="post">
Discussion Content:
<br />
<input type="text" name="name" style="height:200px; width:800px" />
<br />
E-mail:
<input type="text" name="poster@emai.com" />
<br />
<input type="submit" />
</form>
Then I need the second user to be able to respond to the first user's post and second user's reply to be sent directly to first user's email. So this is what I've got and it's not even close. Appreciate any help.
<?php
$from = filter_var($_POST["email1"], FILTER_SANITIZE_EMAIL);
if ( !$from ) {
die('Invalid from email address');
}
$to = "email2";
$subject = 'Test email';
//data
$msg = $_POST['response'];
mail($to, $subject, $msg, 'From: ' . $from);
echo "Mail Sent.";
?>