if (isset($_FILES['uploaded_file']) && $_FILES['uploaded_file']['error'] == UPLOAD_ERR_OK) {
$mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
$_FILES['uploaded_file']['name']);}
这是用于上传第一张图片的代码,该代码正在起作用,并且在附件中获取附件,但如何为第二张图片添加附件。
答案 0 :(得分:0)
正如评论中所提到的,您正在使用PHPMailer,因此您可以这样做:
$mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
$_FILES['uploaded_file']['name']);}
$mail->AddAttachment($_FILES['uploaded_file2']['tmp_name'],
$_FILES['uploaded_file2']['name']);}
您可以遵循以下示例: How to send multiple attachment in single mail in php