Generate And Email Excel File using php
Is this possible without having to first create a physical file on the server?
Initially I had to make a php page that would email each week information about new members of a site... That was fine I just used a cron job running the php pag开发者_如何学Ce weekly... Now I've been asked to set up the email so it sends an Excel file of the data automatically... Does anyone know if this would be even possible? and how?
Regards, Vinoth S
Yes, this is entirely possible. Libraries such as PHP Excel allow you to construct spreadsheets in memory without writing anything to disk. Libraries like Swiftmailer allow you to easily add attachments to e-mails from memory. Simply combine the two to do what you want.
Theoretically, one could create the email attachment by creating a carefully crafted email message. And then carefully constructing a document. This might mean breaking some of the email message composition rules if using the php email function.
Seems possible, but the most feasible implementations would be to use the well-suited tools to do it.
Do you know about OpenOffice? I think that can be scripted to run from a server context.
精彩评论