【发布时间】:2013-01-07 14:15:56
【问题描述】:
我的问题与this一模一样,我得到的附件没有扩展名,如果我手动将扩展名添加到文件中,文件仍然无法识别。是什么原因造成的?
这是添加附件的部分,其余为标准:
foreach($_FILES['uploads']['name'] as $key => $file){
$mail->attachment[] = array($_FILES['uploads']['tmp_name'][$key], $_FILES['uploads']['name'][$key]);
$mail->boundary = "_b" . md5(uniqid(time()));
}
编辑:
在每个附件的开头我都会看到:
name="phpmailer.inc.php"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="phpmailer.inc.php"
这正常吗?
编辑: 此外,我将文件复制到服务器并从那里将它们添加到附件中,但所有文件都是“无名”且大小正确。
【问题讨论】:
标签: php phpmailer email-attachments