title: Undefined Variable Header in PHP SEND MAIL
body: <p>After my user registers, I want them to receive an email from my local host server which I'm running. The same script below works fine on a paid hosting but when I try to run it on my local host I get the following error:</p>
  
  <blockquote>
    <p>NOTE: Undefined Variable: Headers in
    /Applications/XAMPP/xamppfiles/htdocs/site/newuser.php on line 60</p>
  </blockquote>
  
  <pre><code>else {
  
  echo "&lt;br /&gt;&lt;center&gt;** CHECK SPAM **. We have sent a activation code to your email,
   you will not be able to login follow the steps.&lt;/center&gt;";
  
  $name = $_POST['name'];
  $password = sha1(md5($_POST['password']));
  $email = $_POST['email'];
  $cwid = $_POST['cwid'];
  
  $verificationCode = md5(uniqid($_POST['name'], true));
  
  (LINE 60) $headers .= "Reply-To: Kwame Project&lt;d1kwame@gmail.com&gt;\r\n"; 
  $headers .= "Return-Path: Kwame Project&lt;d1kwame@gmail.com&gt;\r\n"; 
  $headers .= "From: Kwame Project&lt;d1kwame@gmail.com&gt;\r\n";
  $headers .= "Organization: Kwame\r\n";
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
  $headers .= "X-Priority: 3\r\n";
  $headers .= "X-Mailer: PHP". phpversion() ."\r\n";
  
  $message = "Hello " . $name . "! It appears you have registed an 
  account with us.\r\nIn order to complete your registration, you must 
  click the link below.\r\n" . $siteURL . "activate.php?
  code=".$verificationCode."\r\nThank you!";
  
  $message = wordwrap($message, 70, "\r\n");
  
  mail($email, 'Activate Your Account', $message, $headers);
  
  
  
  $InsertUser = $database-&gt;prepare("INSERT INTO students (`cwid`, `name`,     
  `password`, `activated`, `activation_code`, `email`, `user_group`) 
  VALUES (?, ?, ?, ?, ?, ?, ?)");
  $InsertUser-&gt;execute(array($cwid, $name, $password, 0,   
  $verificationCode, $email, 0));
  
  header('Refresh: 3; url=login.php');
  }
  
  
  }
  </code></pre>