setFrom('from@example.com', 'First Last'); $mail->addAddress('whoto@example.com', 'John Doe'); $mail->Subject = 'PHPMailer file sender'; $mail->Body = 'My message body'; // Attach the uploaded file $mail->addAttachment($uploadfile, 'My uploaded file'); if (!$mail->send()) { $msg .= "Mailer Error: " . $mail->ErrorInfo; } else { $msg .= "Message sent!"; } } else { $msg .= 'Failed to move file to ' . $uploadfile; } } ?> PHPMailer Upload
Send this file: