PHP Form to Excel then send as email attachment
Posted: Wed Sep 28, 2005 11:54 am
Hi there,
I have a little situation. I am working on a form, basically, that grades people. Now, I got the form made, my outputs are ok. However, there is something I was my form to do, which I think is possible, but is a major road block for me.
Currently, my form does a POST in an Excel file, which is saved with the values that I want.
But I need this file to be send via email to recipient, CC to the user logged in and the part that I am confuse is to send the XLS file as attachment. Is that possible and if so, can someone guide me on how to get my outputted excel form in an attachment ready to send.
I use the header feature to load my POST data from my form to display it in Excel, however, it prompt's the user to either save it to HD or open it.
So basically, I am searching for something that might be able to send the newly created xls file, without having to save it on the server and simply mail it to the specified address .
Thanks for your help.
I have a little situation. I am working on a form, basically, that grades people. Now, I got the form made, my outputs are ok. However, there is something I was my form to do, which I think is possible, but is a major road block for me.
Currently, my form does a POST in an Excel file, which is saved with the values that I want.
But I need this file to be send via email to recipient, CC to the user logged in and the part that I am confuse is to send the XLS file as attachment. Is that possible and if so, can someone guide me on how to get my outputted excel form in an attachment ready to send.
I use the header feature to load my POST data from my form to display it in Excel, however, it prompt's the user to either save it to HD or open it.
Code: Select all
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition:filename=$agent-$userid.xls");Thanks for your help.