Hi. I'm using the following code to send an email with attachments:
$mime_boundary = "<<<--==+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 => $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);
Which works fine, except that an extra file is also attached (called "Part 1.4").
Is there a way to not have this added?
Cheers, Dan.