title: PHP mail with attachment - extra file: part 1.4
body: <p>I'm using the following code to send an email with attachments:</p>
  
  <pre><code>    $mime_boundary = "&lt;&lt;&lt;--==+X[".md5(time())."]";
  
      $headers .= "MIME-Version: 1.0\r\n";
      $headers .= "Content-Type: multipart/mixed;\r\n";
      $headers .= " boundary=\"".$mime_boundary."\"";
  
      $message .= "This is a multi-part message in MIME format.\r\n\r\n";
      $message .= "--".$mime_boundary."\r\n";
  
      $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
      $message .= "Content-Transfer-Encoding: 7bit\r\n";
      $message .= "\r\n";
      $message .= "$message_body\r\n";
      $message .= "--".$mime_boundary."\r\n";
  
      foreach($attachments as $filename =&gt; $data)
      {
          $message .= "Content-Type: application/octet-stream;\r\n";
          $message .= " name=\"$filename\"\r\n";
          $message .= "Content-Transfer-Encoding: quoted-printable\r\n";
          $message .= "Content-Disposition: attachment;\r\n";
          $message .= " filename=\"$filename\"\r\n";
          $message .= "\r\n";
          $message .= chunk_split(base64_encode($data));
          $message .= "\r\n";
          $message .= "--".$mime_boundary."\r\n";
      }
  
      mail($email_address, $email_subject, $message, $headers);
  </code></pre>
  
  <p>Which works fine, except that an extra file is also attached (called "Part 1.4").</p>
  
  <p>Is there a way to not have this added?</p>
  
  <p>Cheers,
  Dan.</p>