title: PHP Mailing script is sending an empty message to my email
body: <p>Ironically enough, even though my code is, syntax-wise, completely correct, when I test it, it sends a message to the email addressed to that has nothing content wise, nor attachment wise. Anyone can tip me on what may have gone wrong? Here's the HTML and PHP, any help is appreciated, thanks!</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;h3 style="padding-left:290px"&gt;Consulta de orçamento&lt;/h3&gt;
  &lt;form id="form" method="post" action="formulario_orcamento.php" style="padding-left:100px" enctype="multipart/form-data"&gt;
      &lt;fieldset&gt;
          &lt;label&gt;&lt;input name="Nome" type="text" value="Nome" id="Nome" onBlur="if(this.value=='') this.value='Nome'" onFocus="if(this.value =='Nome' ) this.value=''"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;input name="E-mail" type="text" value="E-mail" id="E-mail" onBlur="if(this.value=='') this.value='E-mail'" onFocus="if(this.value =='E-mail' ) this.value=''"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;input name="Telefone" type="text" value="Telefone" id="Telefone" onBlur="if(this.value=='') this.value='Telefone'" onFocus="if(this.value =='Telefone' ) this.value=''"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;select name="Duvidas" id="Duvidas" style="height:20px; width: 623px"&gt;
              &lt;option value="Elaboração de questionários"&gt;Elaboração de questionários&lt;/option&gt;
              &lt;option value="Amostragem"&gt;Amostragem&lt;/option&gt;
              &lt;option value="Análise exploratória"&gt;Análise exploratória&lt;/option&gt;
              &lt;option value="Pesquisas online"&gt;Pesquisas online&lt;/option&gt;
              &lt;option value="Tabulação"&gt;Tabulação&lt;/option&gt;
              &lt;option value="Análises específicas"&gt;Análises específicas&lt;/option&gt;
              &lt;option value="Outras Dúvidas"&gt;Outras Dúvidas&lt;/option&gt;
          &lt;/select&gt;&lt;/label&gt;
          &lt;label&gt;&lt;input name="Outras" type="text" value="Outras Dúvidas - Especificar" id="Outras Duvidas" onBlur="if(this.value=='') this.value='Outras Dúvidas - Especificar'" onFocus="if(this.value =='Outras Dúvidas - Especificar' ) this.value=''"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;input name="Arquivos" type="file" style="height:25px"&gt;&lt;/label&gt;
          &lt;label&gt;&lt;textarea name="Mensagem" id="Mensagem" onBlur="if(this.value==''){this.value='Mensagem'}" onFocus="if(this.value=='Mensagem'){this.value=''}"&gt;Mensagem&lt;/textarea&gt;&lt;/label&gt;
          &lt;input type="submit" name="Enviar" id="Enviar" value="Enviar" class="button" style="background:#64d0ff; font-size:14px; color:#fff; display:inline-block; padding:6px 20px 5px 20px; box-shadow:0 1px 1px #fff; width:70px; height:35px" onmouseover="this.style.backgroundColor='#1f497d', this.style.color='#fecf06'" onmouseout="this.style.backgroundColor='#64d0ff', this.style.color='#ffffff'"&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
  
  error_reporting(E_ALL);
  ini_set('display_errors', true);
  
  $name = $_POST['Nome'];
  $email = $_POST['E-mail'];
  $telephone = $_POST['Telefone'];
  $message = $_POST['Mensagem'];
  if($_POST['Duvidas'] == "Outras Dúvidas")
  {
      $question = $_POST['Outras'];
  }
  else
  {
      $question = $_POST['Duvidas'];
  }
  
  if($_FILES['Arquivos']['name'])
  {
      if(!$_FILES['Arquivos']['error'])
      {
          $new_file_name = strtolower($_FILES['Arquivos']['tmp_name']);
          $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x";
  
          $tmp_name = $_FILES['Arquivos']['tmp_name'];
          $ftype = $_FILES['Arquivos']['type'];
          $fname = $_FILES['Arquivos']['name'];
          $fsize = $_FILES['Arquivos']['size'];
      }
  }
  
  if (file_exists($tmp_name))
  {
      if(is_uploaded_file($tmp_name))
      {
          $file = fopen($tmp_name,'rb');
          $data = fread($file,filesize($tmp_name));
          fclose($file);
          $data = chunk_split(base64_encode($data));
      }
  
      $to      = "quick.analytics@2frame.com.br";
      $subject = "Consulta de orçamento";
      $header = "From: danielle.steffen@2frame.com.br"."\r\n";
      $header .= "Content-type: multipart/mixed;\r\n";
      $header .= " boundary=\"{$mime_boundary}\"";
      $header .= "MIME-Version: 1.0\r\n";
  
      $message .= "--{$mime_boundary}\r\n
          Content-Type: {$ftype};\r\n .
          name=\"{$fname}\" \r\n
          Content-Disposition: attachment;\r\n .
          filename=\"{$tmp_name}\" \r\n .
          Content-Transfer-Encoding: base64\r\n
          $data . \r\n ";
  
      $msg = "This is a multi-part message in MIME format.\n\n
          Content-Type: text/plain; charset=\"iso-8859-1\"\n .
          Content-Transfer-Encoding: 7bit\n\n .
          $message . \n\n
          Mensagem enviada em ".date("d/m/Y").", os dados seguem abaixo:\n
          Nome: $name \n
          E-mail: $email \n 
          Telefone: $telephone \n
          Dúvida: $question \n";
  
      if (isset ( $_POST['Enviar']))
      {
          $res = mail($to,$subject,$msg,$header);
      }
      if($res)
      {
          echo 'Mensagem enviada para '.$to.'';
      }
      else
      {
          echo 'Por favor corrija seus erros.';
      }
  }
  ?&gt;
  </code></pre>