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