I am trying to send an email address from my index.php to form.php file. In form.php I get the email address correctly or prints correctly. But when i am trying to sending an email to that particular email address using php mail() function. It's not working. Can anyone suggest me how to fix this ?
index.php
<form method="POST" action="Form.php">
<input type="email" name="email" placeholder="Email" >
<input type="submit" name="submit" id="submit-form" class="hidden" style="display:none">
</form>
Form.php
<p>To :'.$_POST["email"].'</p> // showing email address
<?php
if (isset($_POST['submit'])) {
$to = $_POST["email"]; // does not sending email
$subject = 'my subject';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
$headers[] = 'From: my@email.com';
mail($to, $subject, $hippo , implode("\r\n", $headers));
}
?>
<div id="submitBtn">
<label for="submit-form" class="submitBtn">Submit</label>
</div>