This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Sending pdf through pdfcrowd but not opening pdf in rediffmailpro email id account

pankajhkcl wrote on 2016-04-27:
i have created sending pdf attachement to email using your pdfcrowd api. I have to email ids one email go to gmail which is working fine but in rediffpromail email id account not opening pdf file saying error "unable to load pdf".please help me how to open pdf also in rediffpromail.

my code is:


require 'pdfcrowd.php';

    // generate a PDF file
    $client = new Pdfcrowd("apiusername", "apiuserkey");
     $pdf = $client->convertURI('new.php');
     //Deal with the email
    $to = '';
    $from = '';
    $subject = 'a PDF file for you';
    $content = 'Please find the file attached';
    $attachment = chunk_split(base64_encode($pdf));
    $filename = "myfile.pdf";
    $boundary =md5(date('r', time()));
    $headers = "From: $from\r\nReply-To: $from";
    $headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
    $message="This is a multi-part message in MIME format.
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 8bit

Content-Type: application/pdf; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
    mail($to, $subject, $message, $headers);
catch(PdfcrowdException $e)
    echo "Pdfcrowd Error: " . $e->getMessage();
support wrote on 2016-04-28:

Please send us a copy of the PDF gmail attachment to and we will look into it.
pankajhkcl wrote on 2016-04-28:
Please check attached zipped files .in this one is pdfcrowd.php file and other one is my source code file pdf.php
support wrote on 2016-04-28:
Thanks for the files. In order to be able to help, we need to see the email. Please forward the email generated by your app to