title: Contact Form Says Successful But Not Sending The Email
body: <p>I have a contact form that allows users to upload attachments. Its odd because when I use the contact form, the success message appears but when I check my email, I receive nothing either in my inbox or my spam folder. However, the files that I attach to the message DO appear in my /upload folder so that part seems to be working correctly.</p>
  
  <p>It's just that I don't receive any message or anything. I'm not sure what's wrong. The code is pasted below.  </p>
  
  <pre><code> &lt;?
  
  
  
   if($_SERVER['REQUEST_METHOD'] == "POST")      {                                                            
  $allowedExts = array("gif", "jpeg", "jpg", "png", "doc", "pdf", "docx",  "jpg", "docx", "odt", "txt", "msg", "csv", "pps", "ppt", "pptx", "xml", "tar", "m4a", "mp3", "wav", "wma", "mp4", "mov", "flv", "exe");
  
  
   for ($i = 1; $i &lt;= 2; $i++) {
   $temp = explode(".", $_FILES["attach".$i]["name"]);
   $extension = end($temp);
   if (in_array($extension, $allowedExts)) {
    move_uploaded_file($_FILES["attach".$i]["tmp_name"],
    "upload/" .$_POST["firstname"]."-".$_FILES["attach".$i]["name"]);
   }
   }
  
   $to      = 'myemail@gmail.ca';
   $subject = 'Consultation from '.$_POST["firstname"];
   $message = $_POST["message"]."\n\n\n Attachments: ".$_FILES["attach1"]["firstname"]." ".$_FILES["attach2"]["firstname"]." ".$_FILES["attach3"]["firstname"];
    $firstname=$_REQUEST['firstname'];
    $companyname=$_REQUEST['companyname'];
    $email=$_REQUEST['email'];
  
    if (($firstname=="")||($email=="")||($message=="")) 
       { 
       echo "&lt;strong&gt;&lt;p class =greentip&gt;A first name, message, and email   are required, please fill &lt;a href=/consult.php&gt;the form&lt;/a&gt; again.&lt;/p&gt;&lt;/strong&gt;&lt;br&gt;"; 
      } 
    else{ 
     mail($to, $subject, $message, $firstname, $email);
   echo "&lt;strong&gt;&lt;p class = greentip&gt;Your free consultation request has    been received! Expect a detailed response within the next 3 hours.&lt;/p&gt;&lt;/strong&gt;"; 
      }
    }
    ?&gt;
  
     &lt;form  action="" method="post" enctype="multipart/form-      data"&gt;                       
  
  &lt;strong&gt;First Name *&lt;/strong&gt;&lt;br&gt; 
  &lt;input name="firstname" type="text" value=""&gt;&lt;br&gt;
  
  &lt;strong&gt;Company Name &lt;/strong&gt;&lt;br&gt; 
  &lt;input name="companyname" type="text" value=""&gt;&lt;br&gt;
  
  
  &lt;strong&gt;Email *&lt;/strong&gt;&lt;br&gt; 
  &lt;input name="email" type="text" value=""&lt;br&gt; 
  
  &lt;strong&gt;Your message *&lt;/strong&gt;&lt;br&gt; 
  &lt;textarea name="message" rows="7" cols="30" placeholder="In your query, include any and all revelant information pertaining to the nature of your writing request. The more specific you are in your request, the more complete we will be in our response!"&gt;&lt;/textarea&gt;&lt;br&gt; 
  
  &lt;strong&gt;Attachments&lt;/strong&gt;&lt;br&gt; 
  
     &lt;input name = "attach1" type="file" class="file" /&gt;
  
    &lt;br&gt; 
  
       &lt;input name = "attach2" type="file" class="file" /&gt;
  
    &lt;br&gt;&lt;br&gt;
     &lt;center&gt;&lt;input type="submit" value="submit"&gt;&lt;/center&gt; &lt;br&gt;
      &lt;/form&gt;
  </code></pre>