If you defined your HTML file inputs using the "[]" notation for its name, then instead of this...
$mail->AddAttachment($_FILES['file']['tmp_name']);
$mail->AddAttachment($_FILES['file']['tmp_name']);
$mail->AddAttachment($_FILES['file']['tmp_name']);
$mail->AddAttachment($_FILES['file']['tmp_name']);
...you'll want to do something like this...
foreach($FILES['file']['tmp_name'] as $file_name) {
if(!empty($file_name)) {
$mail->AddAttachment($file_name);
}
}
I'm guessing for now that the error message #2 is coming from that code, and is actually happening before error message #1, which is caused by the output of the #2 errors. If that's not the case, then it could be something else generating output, such as a BOM (byte order mark) before the opening <?php tag (if saving your PHP file as UTF-8, make sure it is without a BOM). If that's not it, then you might want to start the script with an ob_start() to buffer output.