易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP mail Function With Attachments

原帖地址:http://www.zedwood.com/article/126/php-mail-function-with-attachments
This code sends an html formatted email with attachments. This email sending script actually sends both a plaintext and an html body of the email, allowing the email client to choose which to display. The plaintext email is generated by stripping html tags from the html formatted body, and replacing 
with newline characters. 
One of the nice things about this script is that the attachments are stored in an array. If you want to add another attachment, all you have to do is copy and past an existing line in the attachment array, and change the filename. 
For each attachment, it automatically looks up the corresponding mimetype.
$file1='test.pdf';
$file2='test2.tar.gz';
$head = array(
       'to'      =>array('email@email.net'=>'Admin',
                         'email2@email.net'=>'Admin2'),
       'from'    =>array('cron@55.66.77.88' =>'CronAgent'),
       'cc'      =>array('email3@email.net'=>'Admin'),
       'bcc'     =>array('email4@email.net'=>'Admin'),
       );
$subject = date("Ymd")." Weekly Report";
$body ='';
$body.="<div style='font-family:Arial;font-size:10pt;'>";
$body.=    "<br>"."Admin,";
$body.=    "<br>"."";
$body.=    "<br>"."Attached are the files:";
$body.=    "<br>"."* ".$file1;
$body.=    "<br>"."* ".$file2;
$body.=&nbs


相关文档:

php中计算时间差的几种方法

在php中计算时间差有时候是件麻烦的事!不过只要你掌握了日期时间函数的用法那这些也就变的简单了:  
一个简单的例子就是计算借书的天数,这需要php根据每天的日期进行计算,下面就来谈谈实现这种日期计算的几种方法:
(1) 如果有数据库就很容易了!若是MSSQL可以使用触发器!用专门计算日期差的函数datediff()便可 ......

php获取xml属性值

<!-- xml格式
<foo xmlns="test">
<bar attr='a'></bar>
<bar attr='b'></bar>
<bar attr='c'></bar>
</foo>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('attr.xml'))
{
echo "load books.xml failed!<br>";
re ......

PHP结合OpenVC实现人脸识别

最近发现很多网站都有一些圈人头像的功能,后来在网上GG了一下,发现是用OpenCV实现的,我也在内部服务器做了一下测试,如果可以实现,步骤如下:
一 安装
1、安装opencv
官方网站:http://www.opencv.org.cn (中文版)
具体安装方法可以参考官方网站:
http://www.opencv.org.cn/index.php/%E6%BA%90%E7%A0%81%E7% ......

php解析xml示例

<!-- xml 格式
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>

<book id='1002'>
<author>congfeng</author>
<t ......

java和php文件读写对比举例及解决让人头痛的乱码问题

JAVA文件读写必须要注意编码问题 
 java的文件写
直接使用FileWriter即可,第二个参数为追加写入,默认是覆盖写。写完必须close才会保存写好的内容。
默认情况如果没有会新建一个文件
FileWriter fw = null;
try {
fw = new FileWriter("/data/updatetime.dat", true); // true追加写入
fw.append ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号