title: Why doesn't PHP send the email?
body: <p>I am trying to send an email message with data collected from an html form.</p>
  
  <p>Here is the form:</p>
  
  <pre><code>&lt;form action="estimate.php" action="post"&gt;
      &lt;fieldset&gt;
          &lt;input type="text" name="name" value="FULL NAME" onfocus="if (this.value=='FULL NAME') this.value='';"/&gt;
          &lt;input type="text" name="phone" value="PHONE NUMBER" onfocus="if (this.value=='PHONE NUMBER') this.value='';"/&gt;
          &lt;input type="text" name="email" value="EMAIL" onfocus="if (this.value=='EMAIL') this.value='';"/&gt;
          &lt;input type="text" name="date" value="MOVE DATE" onfocus="if (this.value=='MOVE DATE') this.value='';"/&gt;
          &lt;input type="text" name="origin" value="ORIGINATING ADDRESS" onfocus="if (this.value=='ORIGINATING ADDRESS') this.value='';"/&gt;
          &lt;input type="text" name="destination" value="DESTINATION ADDRESS" onfocus="if (this.value=='DESTINATION ADDRESS') this.value='';"/&gt;
          &lt;select name="move-type"&gt;
              &lt;option value="" selected="selected"&gt;TYPE OF MOVE&lt;/option&gt;
              &lt;option value="Private"&gt;Private&lt;/option&gt;
              &lt;option value="Commercial"&gt;Commercial&lt;/option&gt;
          &lt;/select&gt;
          &lt;input id="quoteSubmit" type="image" src="_images/btn_submit.png" alt="" onmouseover="javascript:this.src='_images/btn_submit-over.png'" onmouseout="javascript:this.src='_images/btn_submit.png'"/&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is the PHP (which I got some help on in an earlier question posting):</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Contact Us&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;Email Confirmation Page&lt;/h2&gt;
  &lt;p&gt;This is to prove that something is showing up.&lt;/p&gt;
  &lt;?php # sends contents of  Free Estimate form
  
  if (isset($_POST['submitted'])) {
  $errors = array();
  
  // Check for empty fields
  
  $checkArray = array('name', 'email', 'date', 'origin', 'destination');
  foreach($checkArray as $check) {
      if (empty($_POST[$check])) {
          $errors[] = 'Please enter your '.$check;
      } 
  }
  
  if (empty($errors)) { // everything is okay
  
  $to = "my@email.com";
  
      $body = "The following Free Estimate Request has been submitted:\n
  
          Submitted by: {$_POST['name']}\r
          E-mail: {$_POST['email']}\r
          Phone: {$_POST['phone']}\r
          Move date {$_POST['date']}\r
          Moving from: {$_POST['origin']}\r
          Moving to: {$_POST['destination']}\r
          Move type: {$_POST['move-type']}\r;
  
      ";
  
      mail ($to, 'Free Estimate Request', $body, 'From:  '.$from);      
  
      // end email
  
  } else {    
      echo '&lt;h2&gt;Error!&lt;/h2&gt;
      &lt;p class="errors"&gt;The following error(s) occurred:&lt;br /&gt;';
      foreach ($errors as $msg) {
          echo " - $msg&lt;br /&gt;\n";
      }
      echo '&lt;/p&gt;&lt;p&gt;Please go back and try again.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;';
  }
  };
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The estimate.php page shows up fine and no errors are generated, but I don't get any emails.</p>
  
  <p>Not sure what I am missing here.</p>
  
  <p>Thanks.</p>