title: I've written a newsletter subscriprion in php based on a script i had for a mail form, but $_Post is not working
body: <p>I only get empty mails from the server...</p>
  
  <p>This is the code:</p>
  
  <pre><code>    &lt;?php
      $field_email = $_POST['sub-email'];
  
      $mail_to = 'alex.dapunt@gmail.com';
      $subject = 'Newsletter Subscriprion '.$field_email;
  
      $body_message .= 'E-mail: '.$field_email."\n";
  
      $headers = 'From: '.$field_email."\r\n";
      $headers .= 'Reply-To: '.$field_email."\r\n";
  
      $mail_status = mail($mail_to, $subject, $body_message, $headers);
  
      if ($mail_status) { ?&gt;
          &lt;script language="javascript" type="text/javascript"&gt;
              alert("We'll notify you as soon the new website is online.");
              window.location = 'index.html';
          &lt;/script&gt;
      &lt;?php
      }
      else { ?&gt;
          &lt;script language="javascript" type="text/javascript"&gt;
              alert('Subscription failed. Please, send an email to alex.dapunt@gmail.com');
          // window.location = 'contact_page.html';
      &lt;/script&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>and this the html:</p>
  
  <pre><code>  &lt;form action="send.php" method="post" id="newsletter" data-scroll-reveal="wait 0.5s, then enter bottom and move 20px over 1s"&gt;
          &lt;div class="lj-block-center"&gt;
            &lt;input type="text" value="mail" name="sub-email" id="mail" placeholder="Enter your e-mail"&gt;
            &lt;input type="submit" value="Submit" name="submit"&gt;
          &lt;/div&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>I really don't get why it is not working. But I have to say that I'm a newbie in PHP</p>