this is my code what I want to do is
generate a pdf file(not save it on hd of server but in memory)
then send it as attachement to someone

        $pdf = pdf_new();

                        pdf_begin_page($pdf, 595, 842);
                        pdf_set_font($pdf, "Times-Roman", 30, "host");
                        pdf_set_value($pdf, "textrendering", 1);
                        pdf_show_xy($pdf, "A PDF document created in memory!", 50, 
                        $data = pdf_get_buffer($pdf);

* Filename.......: example.3.php
* Project........: HTML Mime Mail class
* Last Modified..: 15 July 2002

* Example of usage. This example shows
* how to use the class to send a plain
* text email with an attachment. No html,
* or embedded images.
* Create the mail object.
        $mail = new htmlMimeMail();
* Read the file into $attachment.
        $attachment = $mail->getFile('test.pdf');

* Since we're sending a plain text email,
* we only need to read in the text file.
        $text = $mail->getFile('example.txt');

* To set the text body of the email, we
* are using the setText() function. This
* is an alternative to the setHtml() function
* which would obviously be inappropriate here.

* This is used to add an attachment to
* the email.
        $mail->addAttachment($attachment, 'test.pdf', 'application/zip');

* Sends the message.
        $mail->setFrom('Joe <[EMAIL PROTECTED]');
        $result = $mail->send(array('"Richard" <[EMAIL PROTECTED]>'));
        echo $result ? 'Mail sent!' : 'Failed to send mail';

the mail get's send but I get this error
Warning: fopen("test.pdf", "rb") - No such file or directory in 
/home/web/intranet/httpdocs/htmlMimeMail.php on line 162
and test.pdf is included in the mail but is 0kb big
anyone sees the prob ?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to