I want to build a php script which will take user's input from a form and then create a complex document from this and send it as an attachment in an e-mail. I understand how to send mail using php and I can generate a text or html message and send it directly OK. The problem is that I want to send perhaps several files (text or html) as attachments. Each file needs to be created "on the fly" with data from the input form. Has anyone seen anything which does that for me to take a peek?