My clients are in MySql each have documemts stored on the web server, their invoices I need to send each month, so when they reuquest the documents, instead of attaching them in outlook manualy I select the client form a table, and click send, this has their email address, and document(s) names that belong to them. I store the pdf documents in folder called docs each has a unique name that is a number, and each user may have one or many documents but not more than 10. anyway I would use something else but all the other code i tried has issues with the PDF, when i recieve it the document cannot open in pdf it says it was encoded wrong ... so stuff that ... lol .. i dont like that code anyway ... need a degree in rocket sceince to grasp read it and im not the brightest light in the packet :D

I found the suloution however, it was two mistakes I made in my code, the code now looks like this and it works PERFECTLY!

        $attachment_query = "SELECT document FROM transact WHERE clientid=$clientid AND document <> ''";
        $attachemnt_result = mysql_query($attachment_query ) or die (mysql_error());

    while ($records = mysql_fetch_array($attachemnt_result)) {

        $document = $records['document'];
        $directory = "docs/";
        $myfile = $directory.$document;

        $mail->AddAttachment($myfile, $document);



  echo "Message Sent OK</p>\n";