views:

24

answers:

0

I'm trying to encode a PDF to attach is to an email, and the script I'm using requires the following lines of code:

    $headers .= "Content-Transfer-Encoding: base64\r\n";
    $headers .= "Content-Disposition: attachment; filename=\"".$license_filename."\"\r\n\r\n";
    $attachment = chunk_split(base64_encode(file_get_contents($license_path.$license_filename))); 

To process a 60KB file takes about 20 seconds. If I remove the call to base64_encode, execution completes instantly, but of course the attachment in the email is corrupt.

I need to send a PDF that's 560KB - any thoughts on how I can speed up execution, or send the email in an alternative way?

Thanks in advance.