Home > php教程 > php手册 > body text

PHP简单生成excel并发送邮件给用户

WBOY
Release: 2016-06-20 08:42:42
Original
1866 people have browsed it

本文实现PHP发送带excel的邮件大致思路如下:首先生成二维数组,并导入到excel文件当中。然后用phpmailer把生成的文件发送到邮件当中。
PHP简单生成excel并发送邮件给用户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元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template