I have created a simple php file to capture emails from users who are signing up for a newsletter. The 'captured email' is not getting sent through to me. The email I receive is this 'Email: ' without the users email.
<?php
session_start();
//require_once('recaptchalib.php');
$privatekey = "6Ldni7wUAAAAAIMRGmqhTeehXqkx0ZC";
$publickey = "6Ldni7wUAAAAAKO37aO2hfy3kHyXTuN";
$email = $_POST['email'];
$admin_email = 'example@email.com';
$email_from = 'example@email.com';
$email_subject = "Newsletter Signup";
$email_body = "Email: $email \r\n";
$to = "$admin_email";
$headers = "From: $email_from \r\n";
$headers = "Reply-To: $email \r\n";
mail($to,$email_subject,$email_body,$headers);
header("Location: thankyou.html");
?>
HTML
<form method="POST" action="newsletter.php">
<input type="text" name="newsletter" title="" placeholder="Email Address..." required>
<button type="submit">Sign Up</button>
<div class="clearboth"></div>
<div class="g-recaptcha" data-sitekey="6Ldni7wUAAAAAKO37aO2hfy3kHyXTuN"></div>
<label><input name="consent" type="checkbox" class="input-name" required>
<span class="captchaspan obligatorycheck"><!--Some text--></span>
</label>
</form>