使用php生成和发送Excel文件 [英] Generate And Email Excel File using php

查看:176
本文介绍了使用php生成和发送Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是可能的,而不必首先在服务器上创建一个物理文件?

Is this possible without having to first create a physical file on the server?

最初,我不得不制作一个php页面,每周可以发送关于新成员的信息的网站...这很好,我刚刚使用一个cron工作运行php页面每周...现在我被要求设置电子邮件,所以它自动发送一个Excel文件的数据...有没有人知道如果这甚至是可能的话如何?

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 page 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?

问候,
Vinoth S

Regards, Vinoth S

推荐答案

PHP Excel 之类的库可让您在内存中构建电子表格,而无需对磁盘进行任何操作。像 Swiftmailer 这样的图书馆可以让您轻松地从内存中添加附件到电子邮件。简单地结合两个来做你想要的。

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.

这篇关于使用php生成和发送Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆