0
if (isset($_FILES['uploaded_file']) && $_FILES['uploaded_file']['error'] ==  UPLOAD_ERR_OK) {
    $mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
                         $_FILES['uploaded_file']['name']);}

this is the code im using for uploading the first image, this code is working and im getting the attachment in main but how to do it for second image.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Mandeephub
  • 31
  • 4

1 Answers1

0

As mentioned in comments you are using PHPMailer so you can do it like this:

 $mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
                         $_FILES['uploaded_file']['name']);}

 $mail->AddAttachment($_FILES['uploaded_file2']['tmp_name'],
                         $_FILES['uploaded_file2']['name']);}

you can follow this sample: How to send multiple attachment in single mail in php

Danyal Sandeelo
  • 12,196
  • 10
  • 47
  • 78