You should use one of the classes built for that, for example PEAR Mail.
For a bit more explanation, assuming we use just a plain text UTF8 content with the PDF file.
uniqboundary should be replace by some sort of unique string
$fileType is the MIME type of your file
Here the code :
$headers = 'MIME-Version: 1.0'."\r\n"
.'Content-Type: multipart/related; boundary="--uniqboundary"'."\r\n";
$body = '--uniqboundary."\r\n".
.'Content-Type: text/plain; charset=utf-8'."\r\n"
.'Content-Transfer-Encoding: 8bit'."\r\n\r\n"
.$text
.'--uniqboundary'."\r\n"
.'Content-Type: '.$fileType.'; name="'.basename($filename).'"'."\r\n"
.'Content-Transfer-Encoding: base64'."\r\n"
.'Content-Disposition: attachment; filename="'.basename($filename).'"'."\r\n\r\n";
$lineSize = filesize($filename) + 1;
$f = fopen($filename, 'r');
$chunks[] = chunk_split(base64_encode(fread($f, $lineSize)));
fclose($f);
$body .= implode("\r\n", $chunks)
.'--uniqboundary--'."\r\n";
mail($to, $subject, $body, $headers);
It should work.