HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/awaldron/_upmc/pancreaseq.alanwaldron.com/mail-handler.php
<?php
require_once("wp-load.php");
global $wpdb;

$isProd = false;
$okToSend = stristr($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']);

require_once 'vendor/PHPMailer/src/Exception.php';
require_once 'vendor/PHPMailer/src/PHPMailer.php';
require_once 'vendor/PHPMailer/src/SMTP.php';

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

$db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
$settings = $db->get_results("SELECT * FROM bim_settings", ARRAY_A);

$email_to = 'brummittb@upmc.edu';

foreach ($settings as $set) {
    if ($set['name'] === $_POST['formtype']) {
        $email_to = $set['value'];
    }
}

if (isset($_POST['submit_btn']) && $okToSend) {
    $html = '<html><head>';
    $html .= '<style>.btn{display:inline-block;padding:10px 30px;color:#fff;background-color:#3e787d;text-decoration:none;font-size:16px;}</style>';
    $html .= '<body>';
    $html .= $_POST['formtype'] === 'order_email' ? '<h2>Pancreaseq Test Order Form</h2>' : '<h2>Pancreaseq Contact Us Form</h2>';
    $html .= '<p><table>';
    if ($_POST['formtype'] === 'contact_email') {
        $html .= '<tr><td><b>Subject:</b> &nbsp; </td><td>' . $_POST['subject'] . "</td></tr>";
    }
    $html .= '<tr><td><b>Name:</b> &nbsp; </td><td>' . $_POST['fname'] . ' ' . $_POST['lname'] . "</td></tr>";
    $html .= '<tr><td><b>Email:</b> &nbsp;  </td><td>' . $_POST['email'] . "</td></tr>";
    if ($_POST['formtype'] === 'order_email') {
        $html .= '<tr><td><b>Organization:</b> &nbsp;  </td><td>' . $_POST['org'] . "</td></tr>";
        $html .= '<tr><td><b>Country:</b> &nbsp;  </td><td>' . $_POST['country'] . "</td></tr>";
    }
    $html .= '<tr><td><b>&nbsp;</b></td><td>&nbsp;</td></tr>';
    $html .= '<tr><td valign="top"><b>Message:</b></td><td>'.$_POST['message'].'</td></tr>';
    $html .= '</table></body></head></html>';

    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->Mailer = "smtp";
    $mail->Host = "mail.smtp2go.com";
    $mail->Port = "2525"; // 8025, 587 and 25 can also be used. Use Port 465 for SSL.
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = 'tls';
    $mail->Username = "pancreaseq";
    $mail->Password = "we5kAeXj2iJW4o2g";

    $mail->From = $_POST['email'];
    $mail->FromName = $_POST['fname'] . ' ' . $_POST['lname'];
    $mail->AddAddress($email_to);
    $mail->AddReplyTo($_POST['email']);

    $mail->isHTML(true);
    $mail->Subject = $_POST['formtype'] === 'order_email' ? "Pancreaseq Test Order Form" : "Pancreaseq Contact Us Form";
    $mail->Body = $html;
    $mail->Send();
}


header('Location: '.$_SERVER['HTTP_REFERER'].'?sent=1');
//echo '<pre>', print_r($_SERVER), '</pre>';
//echo 'ok';