I'm trying to attach pdf file. when receiving the mail, it seems to have attachment, but attachment content is actually content text of mail:
/ send mail /
$theFile = "mypdf.pdf";
$header = "Content-Type: application/pdf; Content-Disposition: attachment; filename='".$theFile."'; name=".$theFile.";";
mail("foo@foo.com","mail subject","content",$header);
// send mail //
mail looks like:
subject = mail subject
attchment = mypdf.pdf
but when i open attacment in notepad, it only contains "content"
i have also tried to use "application/octet-stream" but no effect.
any idea what i'm doing wrong ?????