PHP mail body forsvinder
Jeg prøver at sende html-mails med attachments ud, men selve mailbody'en forsvinder undervejs, jeg modtager en mail med subject og attachment, men ingen mailbody. Er der nogen som har noget bud?min kode ser således ud:
$from = "barn@nuna.gl";
//Normal headers
$headers = "From: testeren<".$from.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=".$num."\r\n";
$headers .= "--$num\r\n";
// This two steps to help avoid spam
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n";
//$headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n";
$headers .= "X-Mailer: PHP v".phpversion()."\r\n";
// With message
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$headers .= "".$message."\n";
$headers .= "--".$num."\n";
// Attachment headers
$headers .= "Content-Type:".$filetype." ";
$headers .= "name=\"".$name."\"r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment; ";
$headers .= "filename=\"".$name."\"\r\n\n";
$headers .= "".$content."\r\n";
$headers .= "--".$num."--";
Og headeren ser sådan her ud:
From: testeren MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=d3b3b7f77b8f1589d3c3cf494b5ba84f --d3b3b7f77b8f1589d3c3cf494b5ba84f Message-ID: < TheSystem@www.mitdomene.dk> X-Mailer: PHP v5.2.6-0.dotdeb.1 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
<p>O<u>g så s</u>kal der <strong>ellers s</strong>krives <em>noget</em></p>
--d3b3b7f77b8f1589d3c3cf494b5ba84f Content-Type:image/gif name="kekip.GIF"r Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="kekip.GIF" R0lGODlhCAAIAIABAAD/AAAAACH5BAEAAAEALAAAAAAIAAgAAAIMTIBgl8gNo5wvrWYKADs= --d3b3b7f77b8f1589d3c3cf494b5ba84f--