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?
Mail Attachments (from dynamic PDF)
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Mail Attachments (from dynamic PDF)
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)
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.
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)
I take that back, I have figured it out.
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: Mail Attachments (from dynamic PDF)
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.
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.