I have an excel file generated dynamically from a mysql database using the header function. This works as it prompts a dialog box with the save as feature.
header("Content-Type: application/$file_type");
header("Content-Disposition: attachment; filename=database_dump.$file_ending");
header("Pragma: no-cache");
I would like to be able to mail this excel file to a user using cron. Is this possible using the header function or is there a better way to do this?
Thanks