A system that dynamically create pdf, attach it and send to all people in the Db

Good day all programmers in the house. I’m working on a project that involves creation of pdf dynamically, attach each created pdf to the corresponding email address in the database and then send the email and the attachment on a preset day. In a nut shell, I want to create a system that functions like what bank uses to send pdf document of each of their customers’ account details at the month end to each customer.
I can create pdfs one at a time using fdpf. What I want is at the click of a button in my web application, all pdf for each member that will be using the application will be created and attached to the corresponding email address and sent to the right person on a preset day. Please how do I get this achieved? thanks in advance.

I suggest you to use wk2html for PDF creation. It can html + javascript.

Thanks belekevicius. I actually like fpdf and it works great. I just want to know how to do the task I asked about up there. If you have an idea, tha’ll be great. Thanks for sharing.

Well, for starters, I wouldn’t do this.

How big are the PDF’s? Have you asked your users if it’s ok to send potentially mailbox-jamming amounts of PDF to them?
Will your SMTP server allow you to send that many emails in a single day?

Thanks StarLion. The pdfs are not big at all. I’m planning to host on VPS so that there will be no restrictions. Any advice?

Assuming that’s not an issue (which… I’m still thinking it will be, but whatever), break down your steps.
Get list of customers.
For each customer,
Create PDF
Email PDF
Next customer.

Perhaps you can indicate which part of this you are having trouble with.

Thanks StarLion and I’m really sorry for responding late. I actually have an issue with what the steps should be. I am thinking of generating all the pdfs first at a click of button in a directory and on clicking another button meant to send the emails, the script that runs will locate each generated pdfs and attach to the coressponding emails correctly and send to the customers. Is that a better way or there is another better way to doing this? Thanks in advance man.

I’d work it:

Select recipient
Create their PDF
Attach PDF to email and send
delete PDF
repeat for next recipient

that way you only need to have the one PDF that you are about to send taking up space on the server.

Thanks Felgall, foreach should be able to get me through it, I think? I will write the code and test to see how it goes. Thanks a lot.