title: Password recovery not sending email
body: <p>Password recovery not sending email. But it always say that email was sent. Please help me.</p>
  
  <pre><code>&lt;?php
  session_start();
  include_once 'dbconnect.php';
  
  if (isset($_POST['submit'])) {
  
      $email = $_POST['email'];
      $query = mysql_query("SELECT * FROM users WHERE email='" . $email . "' ") or die(mysql_error());
      $run = mysql_affected_rows();
      $password = substr(hash('sha512', uniqid(rand(), 1)), 3, 10);
      $pass = hash('sha512', $password);
      if ($run != 0) {
          $res = mysql_fetch_array($query);
          $to = "$email";
          $subject = "Obnovení hesla";
          $body = "Dobrý den $res-&gt;username, vaše nové heslo je $password";
          $additionalheader = "From: &lt;admin@chat-web.com&gt;";
          mail($to, $subject, $body, $additionalheader);
          if ($email) {
  
              echo"&lt;script&gt;alert('Email byl ĂşspÄ›ĹˇnÄ› odeslĂˇn.')&lt;/script&gt;";
  
          } else {
  
              echo"&lt;script&gt;alert('EmailovĂˇ adresa $email neexistuje.')&lt;/script&gt;";
          }
      }
      $sql = mysql_query("UPDATE users SET password='$pass' WHERE email = '$email'")or die(mysql_error());
  }
  ?&gt;
  </code></pre>