Users can add an attachment to the contact on my website but i do not now how to include the attachment in the PHPMailer script, anybody has an idea?
PHPMailer: http://pastebin.com/B2Wj9nur HTML: http://pastebin.com/qwNsxD4r
Users can add an attachment to the contact on my website but i do not now how to include the attachment in the PHPMailer script, anybody has an idea?
PHPMailer: http://pastebin.com/B2Wj9nur HTML: http://pastebin.com/qwNsxD4r
Pls have a look, not tested.
$mail = new PHPMailer(true);
if (isset($_FILES['uploaded_file']) &&
$_FILES['uploaded_file']['error'] == UPLOAD_ERR_OK) {
$mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],
$_FILES['uploaded_file']['name']);
}
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
//....
//other email code
$mail->Send();