OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
knoblyExpressLandingPage
/
vendor
/
phpmailer
/
phpmailer
/
examples
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/21/2024 10:02:44 AM
rwxr-xr-x
📄
DKIM_gen_keys.phps
3.32 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
DKIM_sign.phps
1.77 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
README.md
8 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
azure_xoauth2.phps
4.08 KB
08/21/2024 10:02:39 AM
rw-r--r--
📄
callback.phps
2.31 KB
08/21/2024 10:02:39 AM
rw-r--r--
📄
contactform-ajax.phps
5.14 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
contactform.phps
3.61 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
contents.html
585 bytes
08/21/2024 10:02:40 AM
rw-r--r--
📄
contentsutf8.html
1.15 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
exceptions.phps
1.66 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
extending.phps
2.63 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
gmail.phps
3.76 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
gmail_xoauth.phps
3.91 KB
08/21/2024 10:02:40 AM
rw-r--r--
📁
images
-
08/21/2024 10:04:07 AM
rwxr-xr-x
📄
mail.phps
1.15 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
mailing_list.phps
3.21 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
pop_before_smtp.phps
2.43 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
send_file_upload.phps
2.08 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
send_multiple_file_upload.phps
2.04 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
sendmail.phps
1.22 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
sendoauth2.phps
4.57 KB
08/21/2024 10:02:40 AM
rw-r--r--
📄
simple_contact_form.phps
3.91 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
smime_signed_mail.phps
4.28 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
smtp.phps
2.25 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
smtp_check.phps
2.07 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
smtp_low_memory.phps
4.93 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
smtp_no_auth.phps
1.87 KB
08/21/2024 10:02:41 AM
rw-r--r--
📄
ssl_options.phps
2.36 KB
08/21/2024 10:02:41 AM
rw-r--r--
Editing: send_file_upload.phps
Close
<?php /** * PHPMailer simple file upload and send example. */ //Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; require '../vendor/autoload.php'; $msg = ''; if (array_key_exists('userfile', $_FILES)) { //First handle the upload //Don't trust provided filename - same goes for MIME types //See http://php.net/manual/en/features.file-upload.php#114004 for more thorough upload validation //Extract an extension from the provided filename $ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION); //Define a safe location to move the uploaded file to, preserving the extension $uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'])) . '.' . $ext; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { //Upload handled successfully //Now create a message $mail = new PHPMailer(); $mail->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 if (!$mail->addAttachment($uploadfile, 'My uploaded file')) { $msg .= 'Failed to attach file ' . $_FILES['userfile']['name']; } if (!$mail->send()) { $msg .= 'Mailer Error: ' . $mail->ErrorInfo; } else { $msg .= 'Message sent!'; } } else { $msg .= 'Failed to move file to ' . $uploadfile; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PHPMailer Upload</title> </head> <body> <?php if (empty($msg)) { ?> <form method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="100000"> Send this file: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> <?php } else { echo htmlspecialchars($msg); } ?> </body> </html>