无法找到PHPMailer附件 - 在文件系统上找不到文件

时间:2013-02-18 20:33:15

标签: php phpmailer

我每次都得到'文件系统中找不到文件'

<?php 
    if($_POST[upload])
    {    
        require_once('incs/phpmailer/phpmailer.php');
        $upload = $_FILES['upload']['tmp_name'];
        $mail = new phpmailer;
        $mail->AddAddress("email@email.com", "Email");
        $mail->AddReplyTo("info@site.com", "Information");
        $mail->WordWrap = 50;    // set word wrap
        $mail->AddAttachment($upload);  // add attachment
        $mail->IsHTML(true);    // set email format to HTML
        $mail->Subject = "Here is the subject";
        $mail->Body = "This is the message body";
        $mail->Send(); // send message
    }      
?>

有谁知道为什么会发生这种情况?

非常感谢。

1 个答案:

答案 0 :(得分:0)

试试这个,

$upload = $_FILES['upload']['name'];