用PHP mail()发MINI邮件时,用hotmail邮箱在WEB页接收时,能看到附件存在,但附件大小为0KB,不能打开下载。而相同的邮件在Gmail和Yahoo的邮箱能正常接收,且用Dreammail客户端接收Hotmail邮件时,附件就能能正常打开、下载附件,请大侠指点一二。急
下面是我邮件的header和body
=================header==================================================
From: xxxxx <[email protected]>
Reply-To: jfisher <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="--c8942792b23e12c8b4286b90ef69e235"
Content-Transfer-Encoding: 7bit
==============body============================================
This is a multi-part message in MIME format.----c8942792b23e12c8b4286b90ef69e235
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bitxxxxxxxx.<br><b>Note:</b>60
<br><br><br><center><a href='www.constructhub.com'><img src="https://xxxx.com/images/xxx.jpg" title='xxxxx'></a></center>----c8942792b23e12c8b4286b90ef69e235
Content-type: application/pdf;
name="COR#1104-7.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="COR#1104-7.pdf"<.....base64 encoded doc (pedigree.doc) of Bucephalus...>
----c8942792b23e12c8b4286b90ef69e235--
下面是我邮件的header和body
=================header==================================================
From: xxxxx <[email protected]>
Reply-To: jfisher <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="--c8942792b23e12c8b4286b90ef69e235"
Content-Transfer-Encoding: 7bit
==============body============================================
This is a multi-part message in MIME format.----c8942792b23e12c8b4286b90ef69e235
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bitxxxxxxxx.<br><b>Note:</b>60
<br><br><br><center><a href='www.constructhub.com'><img src="https://xxxx.com/images/xxx.jpg" title='xxxxx'></a></center>----c8942792b23e12c8b4286b90ef69e235
Content-type: application/pdf;
name="COR#1104-7.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="COR#1104-7.pdf"<.....base64 encoded doc (pedigree.doc) of Bucephalus...>
----c8942792b23e12c8b4286b90ef69e235--
hotmail比较挑剔,必须要在header里加上
"To: ".$receiver_name." <".$receiver_email.">\r\n"
加在From后面
然后就可以了