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支持8种原始类型,其中包括:
4种标量类型:boolean(布尔型)、integer(整型)、float(浮点型)、string(字符型);
2种复合类型:array(数组)、object(对象);
2种特殊类型:resource(资源)、NULL
您可能还会读到一些关于“双精度(double)”类型的参考。实际上 double 和 float 是相同的,由于一些历史的原 ......
解读PHP DOMDocument在解析XML文件中的作用
http://developer.51cto.com 2009-12-02 10:39 佚名 柳城博客 我要评论(0)
PHP DOMDocument的功能非常强大,我们在这篇文章中将介绍如何正确的运用PHP DOMDocument来进行XML文件的解析。希望对又需要的朋友有所帮助。
在使用PHP对XML文件进行解析的时 ......
最近发现很多网站都有一些圈人头像的功能,后来在网上GG了一下,发现是用OpenCV实现的,我也在内部服务器做了一下测试,如果可以实现,步骤如下:
一 安装
1、安装opencv
官方网站:http://www.opencv.org.cn (中文版)
具体安装方法可以参考官方网站:
http://www.opencv.org.cn/index.php/%E6%BA%90%E7%A0%81%E7% ......
在javascript中用法举例
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
在php中用法举例
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
在java中用法举例 ......