PHP邮件发送问题

PHP邮件发送问题

<?php
$from = "[email protected]";
$email= "[email protected]";
$subject= "邮件主题";
$attachment= "C:\\apache\\htdocs\\test.doc";
$boundary= uniqid("");
$headers= "
From: $from
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary=".$boundary."
";
$fp = fopen($attachment, "r");
$read= fread($fp, filesize($attachment));
//$read= str_replace("***", $value[username], $read);
$read= base64_encode($read);
$read= chunk_split($read);
$body= "
--$boundary
Content-Type:application/msword; charset=gb2312
Content-Transfer-Encoding: base64 $read
--$boundary";
//发送MAIL
mail($email, $subject, $body, $headers);
?>

发送到信箱的是一个:At00001.doc的0字节文件,找不出原因了,帮一下,在线等.我说的是附件到邮箱是这样显示的

[ 本帖最后由 zidian05 于 2008-7-18 15:26 编辑 ]

快来人帮忙啦,在线等解决办法

用phpmailer发邮件吧
如履薄冰