Blogger Information
Blog 9
fans 0
comment 0
visits 14538
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
phpMail发送附件失败
小张的博客
Original
962 people have browsed it

利用phpmail发送邮件时,不带附件市可以发送成功的。但是带上附件就失败,最后找到原因是

basename函数和dirname函数都是不支持中文文件名的

打开class.phpmailer.php,在大概第2784行左右

在 basename下面加入如下代码即可

实例

if (false === strpos($path,'/')) 
            $filename = $this->EncodeHeader($path); 
            else 
            $filename = $this->EncodeHeader(substr($path, strrpos($path, '/') + 1));

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post