If I have a attachment script (below), how do I get the attachment's name or where does $attach_name go?
<?php
if($attach) {
$fd=fopen("file://".$attach, "r");
$content=fread($fd,filesize("file://".$attach));
$encoded=chunk_split(base64_encode($content));
$body = "--Message-Boundary\n";
$body .= "Content-type: text/plain; charset=US-ASCII\n";
$body .= "Content-transfer-encoding: 7BIT\n";
$body .= "Content-description: Mail Message Body\n\n";
$body .= $msgbody;
$body .= "\n\n--Message-Boundary\n";
$body .= "Content-type: text/plain; name=\"$attach_name\"\n";
$body .= "Content-transfer-encoding: BASE64\n";
$body .= "Content-disposition: attachment; filename=\"$attach_name\"\n\n";
$body .= $encoded;
$body .= "--Message-Boundary--";
$header = "FROM: ".$from."\n";
$header .= "X-attachments: $attach_name";
} else {
$body = $msgbody;
$header = "FROM: ".$from;
}
mail($to,$subject,$body,$header);
?>