title: PHP contact form submitting but not receiving email
body: <p>I realise this question has been asked numerous times before but everyone's code is obviously different and I am quite new to php so just looking to see if someone can give me some help.</p>
  
  <p>I have created a basic contact form for a site but for some reason the information is not being sent to my email address although I believe that the form is submitted?</p>
  
  <p>my PHP code is:</p>
  
  <pre><code>&lt;?php
  session_start();
  //$to_mail = "architects@palavin.com,t.lavin@palavin.com,12yorkcourt@gmail.com";
  $to_mail = "danny@enhance.ie";
  //$cc="paul@enhance.ie";
  $mail_sent = 0;
  if(isset($_POST['submit'])){
      //echo "the form was submitted";
  
  $error= array();
  
  $name = trim(strip_tags($_POST['name']));
  if($name == "")
      $error['name'] = 1;
  
  $email = trim(strip_tags($_POST['email']));
  if($email == "")
      $error['email'] = 1;
  
  $phone = trim(strip_tags($_POST['phone']));
  
  $address = trim(strip_tags($_POST['address']));
  
  $description = trim(strip_tags($_POST['description']));
  
  $str = trim(strip_tags($_POST['secu']));
  if ( isset($_SESSION['code_']) &amp;&amp; $_SESSION['code_'] == strtoupper($str)){} else {$error['secu'] = 1;}
  
  
  if(empty($error)){
      $headers = 'From: "Euro Insulation" &lt;no-reply@euroinsulations.ie&gt;'."\r\n";
      //$headers .= 'CC: "'.$cc.'" &lt;'.$cc.'&gt;'."\r\n";
      $headers .= 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=utf-8' . "";
  
  
  
      $subject = "New contact message";
  
      $message = "New Contact message, received from: &lt;br /&gt; \n ";
      $message .= "&lt;b&gt;Name&lt;/b&gt; ".$name."&lt;br /&gt; \n";
      $message .= "&lt;b&gt;Email&lt;/b&gt; ".$email."&lt;br /&gt; \n";
  
      $message .= "&lt;b&gt;Phone&lt;/b&gt; ".$phone."&lt;br /&gt; \n";
      $message .= "&lt;b&gt;Address&lt;/b&gt; ".$address."&lt;br /&gt; \n";
  
      $message .= "&lt;b&gt;Description&lt;/b&gt; ".$description."&lt;br /&gt; \n";
  
      if(@mail($to_mail,$subject,$message,$headers ))
      {
          echo "mail sent";
          $mail_sent = 1;
      }
      else echo "mail not sent";
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>my html form looks like this:</p>
  
  <pre><code>&lt;table width="100%"  border="0" cellspacing="0" cellpadding="10"&gt;
                  &lt;tr&gt;
                    &lt;td width="65%" valign="top"&gt;&lt;p class="header"&gt;&lt;br&gt;
          Contact US &lt;br&gt;
                    &lt;/p&gt;
                        &lt;?php if($mail_sent==1){
      print "Thank you for your message.";
  } else { ?&gt;
  &lt;form class="email_sub" method="post" &gt;
  
  &lt;table width="77%"  border="0" align="center" cellpadding="2" cellspacing="0"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;label for="name" class="formtext" &lt;?php if($error['name']==1) echo "style='color:red;'" ?&gt; &gt;Name:&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="name" id="text"  &lt;?php if($name) echo "value='".$name."'" ?&gt;  /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;label for="phone" class="formtext"&gt;Number:&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="phone" id="phone"/&gt;&lt;tr&gt;
  &lt;br /&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;label for="email" class="textarea" &lt;?php if($error['email']==1) echo "style='color:red;'" ?&gt;&gt;Email:&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="email" id="email"  &lt;?php if($email) echo "value='".$email."'" ?&gt;  /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;&lt;label for="address" class="textarea"&gt;Address/Location of project:&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;textarea rows="3" cols="20" name="address" id="address" style="width: 400px;"&gt;&lt;?php if($address!="") echo $address ?&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;br /&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;label for="description" class="fixedwidth"&gt;Enquiry&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;textarea rows="3" cols="20" name="description" id="description" style="width: 400px;"&gt;&lt;?php if($description!="") echo $description; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;!-- form --&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;label&gt;&amp;nbsp;&lt;/label&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" value="Submit" name="submit" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;?php } ?&gt;        
  </code></pre>
  
  <p>Am i missing something obvious here?? Any help will really be appreciated thanks!</p>