齐天大圣生命中的最后几天
本报驻天庭前方记者“无心”发回的报道,天河天马饲养协会顾问;...
- 娱乐乐园,
作者 unana 发布于 0000-00-00 分类:php基础编程
我写了一个邮件发送程序,粘添了附件之后从信箱里打开,发现:
(由于邮件格式不规范,或者使用了系统不支持的编码,导致邮件解码出错,请下载后尝试使用outlook express阅读)
我的程序是:
if($send)
{
$boundary=uniqid("");
$headers="from
from
content-type:multipart/mixed;boundary="$boundary"";
if($attachment_type)
$mimetype=$attachment_type;
else
$mimetype="application/unknown";
$filename=$attachment_name;
$fp=fopen($attachment,"r");
$read=fread($fp,filesize($attachment));
$read=base64_encode($read);
$read=chunk_split($read);
$body="--$boundary
count-type:text/plain;charset=iso-8859-1
content-transfer-encoding:8bit
$body
--$boundary
content-type
mimetype;name = $filename
content_disposition:attachment;filename = $filename
content-transfer-encoding:base64
$read;
--$boundary--";
mail($to,$subject,$body,$headers);
逛论坛交流:帮忙
0 条回复
回复