I am trying to make a form with a file upload line that sends as an attachment. I'm getting the email with the $body but no attachment I've looked over the code and done research everywhere so now I'm here, Any suggestions?
The PHP Code
if ( isset( $_FILES['upload'] ) && $_FILES['upload']['error'] == UPLOAD_ERR_OK ) {
$mail->IsHTML(true);
$mail->AddAttachment( $_FILES['upload']['tmp_name'], $_FILES['upload']['name'] );
}
The HTML Code
<form action="include/contractor.php" method="post" enctype="multipart/form-data">
<label for="upload">File</label>
<input type="file" name="upload" id="upload" /></form>