我正在使用PHP Mail允许某人上传文件,然后将其发送到电子邮件地址。
这可以使文件正常运行,但是出于某种原因通过电子邮件发送TMP文件?
我尝试上传PDF,JPEG,PNG等,它们的结果相同。
谢谢
HTML:
<p>Press Button: <input type="file" name="file" id="file"/></p>
<a href="javascript:checkValues()" class="button expand" >Button</a>
PHP:
$file = $_FILES['file'];
$file2 = $file['tmp_name'];
$mail->AddAttachment($_FILES); //Does nothing
$mail->AddAttachment($_FILES['file']); //Does nothing
$mail->AddAttachment($_FILES['file']['name']); //Does Nothing
$mail->AddAttachment($_FILES['file']['tmp_name']); //Does Nothing
$mail->AddAttachment ($file2); //sends a blank TMP file