Emailing attachments - with a twist!
Moderator: General Moderators
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
Emailing attachments - with a twist!
Here's what I'm doing. I'm using FPDF library to create a pdf file populated with data culled from DB and forms. So far so good. It is displayed for the user to see/save/print. But now I have to also e-mail it to the user. I'm not sure how to go about this. Because it is dynamically created, I can't just fopen it as usual. Obviously, when dusplaying it, I link to a .php file which then tells the browser it has a pdf file coming then sends pdf-looking data. I am just at a loss as how to get that data and send it. Any ideas? (PS, I'm alse new to the mail() function, having only used it so far for simple admin, debugging emails to myself where I didn't care about formatting or anything. But I figure I can learn that alright from the documentation and other posts)
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
magicrobotmonkey wrote:Hey congrats on you 1000th post
Thanks
I'd rather investigate the mail function first (this article may be handy) and then FPDF. When you've found a solution without writing to a file, please post it - I'd be very interested.magicrobotmonkey wrote:I think im going to investigate just how FPDF makes a pdf before deciding on the best course of action. I was just hoping someone would have experienced this before and happen to have an idea about how to do it. Thanks!
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
Ok, just to let you know what I'm thinking is to somehow run the php file that creates the PDF and grab the output of it, inserting that into the email as a binary attachment deal - Not exactly sure how I'm going to do that just yet and I'm currently at work and supposed to be managing accounts not playing with php so I'll mess with it tonight. Oh - and I already read that article, so I feel like I know what I need to be able to put into the mail, its just a matter of getting it!