I need some functionality that I'm not sure how to approach.
I need a user click a button that would call my script that generates a PDF, then I need to get user's email address registered with his/her session and email a simple message saying something like: " Here's the cocument requested" and attach that PDF, then just reload the page and show a confirmation message "...your document was sent to your ... email address".
Now, I probably can figure out most of this, except sending an attachment -- never done that.
Also, depending on the size of the PDF it may take a few seconds to generate it. How do I know that it's ready before I email it?
Any suggestions?