PHP Form to Excel then send as email attachment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Moloch
Forum Newbie
Posts: 2
Joined: Wed Sep 28, 2005 11:52 am

PHP Form to Excel then send as email attachment

Post by Moloch »

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.

Code: Select all

header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition:filename=$agent-$userid.xls");
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.
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

google php email class attachments
=>
PHPMailer: http://phpmailer.sourceforge.net/

;) That should take care it.
Post Reply