title: How to fix Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in C:\xampp\htdocs\.. on line 22 ERROR
body: <p>I'm new to PHP and have taken a script as an example online.
  I have setup Xampp and the php is installed and working.
  I've attempted to setup a local mailserver with hMailServer, however I'm not entirely sure if that's setup correctly.
  Anyhow, here's the PHP code:</p>
  
  <pre><code>&lt;?php
  
  $subject="";
  $detail="";
  $customer_mail="";
  $name="";
  
  // Contact subject
  $subject ="$subject"; 
  
  // Details
  $message="$detail";
  
  // Mail of sender
  $mail_from="$customer_mail"; 
  
  // From 
  $header="from: $name &lt;$mail_from&gt;";
  
  // Enter your email address
  $to ='sean.myers92@gmail.com';
  $send_contact=mail($to,$subject,$message,$header);
  
  // Check, if message sent to your email 
  // display message "We've recived your information"
  if($send_contact){
  echo "We've recived your contact information";
  }
  else {
  echo "ERROR";
  }
  ?&gt;
  </code></pre>
  
  <p>And the corresponding HTML code:</p>
  
  <pre><code>&lt;table width="400" border="0" align="center" cellpadding="3" cellspacing="1"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;strong&gt;Contact Form &lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;table width="400" border="0" align="center" cellpadding="0" cellspacing="1"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;form name="form1" method="post" action="test.php"&gt;
  &lt;table width="100%" border="0" cellspacing="1" cellpadding="3"&gt;
  &lt;tr&gt;
  &lt;td width="16%"&gt;Subject&lt;/td&gt;
  &lt;td width="2%"&gt;:&lt;/td&gt;
  &lt;td width="82%"&gt;&lt;input name="subject" type="text" id="subject" size="50"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Detail&lt;/td&gt;
  &lt;td&gt;:&lt;/td&gt;
  &lt;td&gt;&lt;textarea name="detail" cols="50" rows="4" id="detail"&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Name&lt;/td&gt;
  &lt;td&gt;:&lt;/td&gt;
  &lt;td&gt;&lt;input name="name" type="text" id="name" size="50"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Email&lt;/td&gt;
  &lt;td&gt;:&lt;/td&gt;
  &lt;td&gt;&lt;input name="customer_mail" type="text" id="customer_mail" size="50"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="Submit" value="Submit"&gt; &lt;input type="reset" name="Submit2" value="Reset"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>When I submit the form I get the error Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required.
  Any ideas what could be wrong?
  Thanks</p>