Page 1 of 1
Mail Attachments (from dynamic PDF)
Posted: Thu May 08, 2008 2:03 pm
by icesolid
Is there anyway to take a dynamically created PDF (I use
http://html2fpdf.sourceforge.net/) and attach that to an e-mail?
I know how to add an attachment to a e-mail using mail();, I am just not sure how to take this dynamically created PDF file and attach it to a e-mail. Maybe save the file in a temp directory?
Re: Mail Attachments (from dynamic PDF)
Posted: Thu May 08, 2008 4:08 pm
by JAB Creations
I would imagine you'd want to create the file on the server with a unique
name.pdf (maybe the name matches the session id?), attach it after it's created, and then delete the file after the email is sent? I'm not sure how it would be coded though I comprehend the steps you seem to be missing. There may also be other methods of achieving this goal though hopefully this will spark some ideas that may help you produce something that will lead you to your goal. Good luck!

Re: Mail Attachments (from dynamic PDF)
Posted: Fri May 09, 2008 8:35 am
by icesolid
I am just stuck on the part where I take that dynamically generated PDF and save it to a temp directory.
The PDF gets dynamically created like so; create_pdf.php?id=10000
I can't figure out how to take that and save it to a file.
Re: Mail Attachments (from dynamic PDF)
Posted: Fri May 09, 2008 9:15 am
by icesolid
I take that back, I have figured it out.
Re: Mail Attachments (from dynamic PDF)
Posted: Fri May 09, 2008 4:02 pm
by flying_circus
Good!
I was going to add that I've got a similar script. When emailing, the PDF gets saved to a temp directory and then deleted once the email is sent.