Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (!permission_exists('email_log_view')) { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //send email //validate the token $token = new token; if (!$token->validate('/app/email_logs/email_logs.php')) { //message::add($text['message-invalid_token'],'negative'); echo ""; echo "
\n"; echo $text['message-invalid_token']; echo "

\n"; echo " \n"; echo "
\n"; exit; } $recipient = check_str($_POST['to']); echo "".$text['header-settings']."\n"; echo "

\n"; ksort($_SESSION['email']); foreach ($_SESSION['email'] as $name => $setting) { foreach ($setting as $type => $value) { if ($type == 'uuid') { $uuid = $value; continue; } if ($name == 'smtp_password') { $value = '[REDACTED]'; } if (permission_exists('default_setting_edit')) { echo "".$name.': '.$value."
\n"; } else { echo $name.': '.$value."
\n"; } } } echo "

\n"; echo "".$text['header-connection']."\n"; echo "

\n"; $eml_body = "Test Message

\n"; $eml_body .= "This message is a test of the SMTP settings configured within your PBX.
\n"; $eml_body .= "If you received this message, your current SMTP settings are valid.

\n"; ob_start(); $sent = !send_email($recipient, 'Test Message', $eml_body, $eml_error, null, null, 3, 3) ? false : true; $response = ob_get_clean(); echo $response; echo "

\n"; echo "".$text['header-result']."\n"; echo "

\n"; echo $sent ? "Message Sent Successfully
Receipient: ".$recipient."" : "Message Failed...
".$eml_error; echo "
\n"; echo "
\n"; echo " \n"; echo "
\n"; ?>