I've got a problem with this script
<?php
$to = 'email@gmail.com';
$subject = $_POST['subject'];
$message = $_POST['message'];
$email = $_POST['email'];
$headers = 'From: '. $email . "\r\n" .
'Reply-To: email2@exaple.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
Script sends an email but I can't see Addressee. There is problem with $email variable. If I use <?php echo $email ?>
I can see it.
There is a form
<form method="post" action="mail.php">
(...)
<div class="col-md-4">
<div class="form-group">
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="Email" required="required">
<p class="help-block text-danger"></p>
</div>
</div>