OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
aws-ses
/
vendor
/
phpmailer
/
phpmailer
/
examples
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 10:51:32 AM
rwxr-xr-x
📄
DKIM_gen_keys.phps
3.32 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
DKIM_sign.phps
1.77 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
README.md
8 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
azure_xoauth2.phps
4.08 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
callback.phps
2.31 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
contactform-ajax.phps
5.14 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
contactform.phps
3.61 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
contents.html
585 bytes
08/14/2024 10:51:28 AM
rw-r--r--
📄
contentsutf8.html
1.15 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
exceptions.phps
1.66 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
extending.phps
2.63 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
gmail.phps
3.76 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
gmail_xoauth.phps
3.91 KB
08/14/2024 10:51:28 AM
rw-r--r--
📁
images
-
08/14/2024 10:52:58 AM
rwxr-xr-x
📄
mail.phps
1.15 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
mailing_list.phps
3.21 KB
08/14/2024 10:51:28 AM
rw-r--r--
📄
pop_before_smtp.phps
2.43 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
send_file_upload.phps
2.08 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
send_multiple_file_upload.phps
2.04 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
sendmail.phps
1.22 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
sendoauth2.phps
4.57 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
simple_contact_form.phps
3.91 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
smime_signed_mail.phps
4.28 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
smtp.phps
2.25 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
smtp_check.phps
2.07 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
smtp_low_memory.phps
4.93 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
smtp_no_auth.phps
1.87 KB
08/14/2024 10:51:29 AM
rw-r--r--
📄
ssl_options.phps
2.36 KB
08/14/2024 10:51:29 AM
rw-r--r--
Editing: simple_contact_form.phps
Close
<?php /** * PHPMailer simple contact form example. * If you want to accept and send uploads in your form, look at the send_file_upload example. */ //Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; require '../vendor/autoload.php'; if (array_key_exists('to', $_POST)) { $err = false; $msg = ''; $email = ''; //Apply some basic validation and filtering to the subject if (array_key_exists('subject', $_POST)) { $subject = substr(strip_tags($_POST['subject']), 0, 255); } else { $subject = 'No subject given'; } //Apply some basic validation and filtering to the query if (array_key_exists('query', $_POST)) { //Limit length and strip HTML tags $query = substr(strip_tags($_POST['query']), 0, 16384); } else { $query = ''; $msg = 'No query provided!'; $err = true; } //Apply some basic validation and filtering to the name if (array_key_exists('name', $_POST)) { //Limit length and strip HTML tags $name = substr(strip_tags($_POST['name']), 0, 255); } else { $name = ''; } //Validate to address //Never allow arbitrary input for the 'to' address as it will turn your form into a spam gateway! //Substitute appropriate addresses from your own domain, or simply use a single, fixed address if (array_key_exists('to', $_POST) && in_array($_POST['to'], ['sales', 'support', 'accounts'], true)) { $to = $_POST['to'] . '@example.com'; } else { $to = 'support@example.com'; } //Make sure the address they provided is valid before trying to use it if (array_key_exists('email', $_POST) && PHPMailer::validateAddress($_POST['email'])) { $email = $_POST['email']; } else { $msg .= 'Error: invalid email address provided'; $err = true; } if (!$err) { $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = 'localhost'; $mail->Port = 25; $mail->CharSet = PHPMailer::CHARSET_UTF8; //It's important not to use the submitter's address as the from address as it's forgery, //which will cause your messages to fail SPF checks. //Use an address in your own domain as the from address, put the submitter's address in a reply-to $mail->setFrom('contact@example.com', (empty($name) ? 'Contact form' : $name)); $mail->addAddress($to); $mail->addReplyTo($email, $name); $mail->Subject = 'Contact form: ' . $subject; $mail->Body = "Contact form submission\n\n" . $query; if (!$mail->send()) { $msg .= 'Mailer Error: ' . $mail->ErrorInfo; } else { $msg .= 'Message sent!'; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PHPMailer Contact Form</title> </head> <body> <h1>Contact us</h1> <?php if (empty($msg)) { ?> <form method="post"> <label for="to">Send to:</label> <select name="to" id="to"> <option value="sales">Sales</option> <option value="support" selected="selected">Support</option> <option value="accounts">Accounts</option> </select><br> <label for="subject">Subject: <input type="text" name="subject" id="subject" maxlength="255"></label><br> <label for="name">Your name: <input type="text" name="name" id="name" maxlength="255"></label><br> <label for="email">Your email address: <input type="email" name="email" id="email" maxlength="255"></label><br> <label for="query">Your question:</label><br> <textarea cols="30" rows="8" name="query" id="query" placeholder="Your question"></textarea><br> <input type="submit" value="Submit"> </form> <?php } else { echo $msg; } ?> </body> </html>