phpMailer sending attachment name, not attachment
问题 Hi I have a file upload field with name="file1" and code in a phpmailer script: if (isset($_FILES['file1'])) { $file1_path = $_FILES['file1']['tmp_name']; $file1_name = $_FILES['file1']['name']; $file1_type = $_FILES['file1']['type']; $file1_error = $_FILES['file1']['error']; $mail->AddAttachment($file1_path); } And for some reason, it attached like php45we34 (each time diff, seems that its the temp name path, not the actual file) Any help? 回答1: I suggest you to use function move_uploaded