PHP简单生成excel并发送邮件给用户
程序员文章站
2022-06-09 18:26:22
...
本文实现PHP发送带excel的邮件大致思路如下:首先生成二维数组,并导入到excel文件当中。然后用phpmailer把生成的文件发送到邮件当中。
include_once 'function.php';
$email = $_POST['email'];
$titles = array("id", "时间", "名称"); //excel 列
$datas = array(
0 => array(
"id" => "1",
"date" => date("Y-m-d", strtotime("-1 day")),
"name" => "素材火"
),
1 => array(
"id" => "2",
"date" => date("Y-m-d"),
"name" => "分享微博送30积分"
),
);
$file_name = date("Y-m-d") . "素材火excel发送";
$attachments = sendExcel($file_name, $titles, $datas);
PHP在线生成excel并发送邮件DEMO演示:http://www.sucaihuo.com/js/871.html AD:真正免费,域名+虚机+企业邮箱=0元