Im in the middle of making a dynamic multi part email and have come accross a snag.
The function receives a file, and depending on the content of that file it then processes the relevant headers and mixed parts, however, rather than echoing the items i need to put them into variables.
there are two examples below, 1 being plain text, the other is the same but in a variable. If I call the variable it will not attach. Only when I use the plain text it will attach.
Can anybody see the difference
Content-Type: application/<?php echo $filetype;?>; name="<?php echo $filename; ?>" Content-Transfer-Encoding: base64 Content-Disposition: attachment
$attachment_header = "Content-Type: application/" . $filetype . "; name=\"" . $filename . "\"\r\n "; $attachment_header .= "Content-Transfer-Encoding: base64 Content-Disposition: attachment"; echo $attachment_header;