Faced a problem. The form does not send data. An empty letter arrives in the mail. Only header and sender. Wordpress site
Here is the code:
<div class="form_back"> <p class="text"><h1>Contact to us</h></p> <?php $to = "blabla@mail.com"; $subject = 'New message for you'; $message = $_POST['mess']; $headers = 'From: info@mail.com'; mail($to, $subject, $message, $headers); ?> <form action="" action="<?php echo get_permalink(); ?> " method="post"> <ol style="list-style-type: none;"> <div><h5>Your name</h5></div> <li><input type="text" name="name" required="required"/></li> <div><h5>Your email</h5></div> <li><input type="text" name="email" required="required"/></li> <div><h5>Message</h5></div> <li><textarea name="mess"></textarea></li> <li><h4><input type="submit" value="Send message" name="submit"></h4></li> </ol> </form> </div>
$_POST['mess']
, did you check? Maybe there is empty ... - Roman Grinyov