Forum Moderators: coopster
A partial code example follows:
$headers .= "Content-Type: multipart/mixed; boundary=lkufg46bsfd\n";
$message = "--lkufg46bsfd
$comments
--lkufg46bsfd
Content-type: text/html; name=$candidate_row[last].htm\n
Content-disposition: attachment; filename=$candidate_row[last].htm\n
<html>Generated content</html>
--lkufg46bsfd--
";
mail($to, $subject, $message, $headers);
The first few lines of the attachment that arrives are
Content-type: text/html; name="Coetzer.htm"
Content-disposition: attachment; filename="Coetzer.htm"
<html>and the rest of the HTML as it should be.
If I take the first few lines of the attachment out (up to the beginning of the <html> and save it with the extension .htm it then displays exactly as it should in a browser.
Can anybody spot my mistake? It is driving me mad.
<edit>spelling</edit>
i have no answer on your question in specific, but for multipart messages (even with the mail function) i would take a look at phpmailer. it's a php class which is an easy interface to send mime mails (html mails, inline images, attachments) with the php mail function and directly through servers. just google for it, will be the first entry.