![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
<?php
$fileName =$upload_name;
$op=fopen($upload,"r");
$read=fread($op,filesize($upload));
$read=base64_decode($read);
$read=chunk_split($read);
$from="hao78326@163.com";
$boundary=uniqid( "");
$headers = "From: $from Content-type: multipart/mixed; boundary=\"$boundary\"";
$body="Content-type:text/plain; charset=iso-8859-1 Content-transfer-encoding: 8bit $_POST[content] --$boundary Content-type: image/jpg; name=$fileName Content-disposition: attachment; filename=$fileName Content-transfer-encoding:base64 $read --$boundary--";
$a=mail($_POST[email],$_POST[title],$body,$headers);
echo $a;
?>
我要死。改了无数边也不好使。结果是这样
Content-type:text/plain; charset=iso-8859-1 Content-transfer-encoding: 8bit PHP邮件发送测试内容 --43181e3d49163 Content-type: image/jpg; name=3.jpg Content-disposition: attachment; filename=3.jpg Content-transfer-encoding:base64 --43181e3d49163--
附件也不能显示
看在大家是同行的份上救救我吧。要不我真的就要死了。
(为什么结果会把代码显示出来,附件也只有名字)
先谢谢了

