mail attachment
Posted: Wed Oct 29, 2003 6:15 am
I am trying to use PHP mailer to email a pdf document generated on the fly using the FPDF library.
here is the relevant portion of my code
Now the problem i am having is with the AddAttachment statement. If i state it like this
it does send the email with the attachment, but if i use the variable $doc as above it does not send the email.
Would be grateful for any comments on this code.
here is the relevant portion of my code
Code: Select all
<?php
//output generated pdf to a file named test.pdf.
$pdf->Output("test.pdf");
$pdf->Close();
//assign the generate pdf to a variable call $doc
$doc=$pdf;
//code to initialize php mailer goes here ... then i have
$mail->AddAddress("a@myemail.com");
$mail->AddAttachment($doc);
?>Code: Select all
<?php
$mail->AddAttachment("test.pdf");
?>Would be grateful for any comments on this code.