4 // by Mischa Peters <mischa at high5 dot nl>
5 // Copyright (c) 2022 High5!
6 // License Info: LICENSE.TXT
10 // Template File: sendmail.tpl
12 // Template Variables:
19 // POST / GET Variables:
25 require_once './functions.inc.php';
26 include './languages/' . check_language() . '.lang';
28 $SESSID_USERNAME = check_session();
29 $ROLE = check_role($SESSID_USERNAME);
31 if ($ROLE == ADMIN_ROLE) {
32 $list_domains = list_domains();
33 $list_admins = list_admins();
35 $list_domains = list_domains($SESSID_USERNAME);
38 if ($_SERVER['REQUEST_METHOD'] == "POST") {
39 $to = strtolower(filter_input(INPUT_POST, 'to', FILTER_VALIDATE_EMAIL));
40 $subject = filter_input(INPUT_POST, 'subject', FILTER_DEFAULT);
41 $body = filter_input(INPUT_POST, 'body', FILTER_DEFAULT);
43 $headers = "From: " . $SESSID_USERNAME . "\r\n";
44 $headers .= "Content-Type: text/plain; charset=utf-8\r\n";
47 $message = $LANG['Sendmail_to_text_error'];
50 if (empty($message)) {
51 if (!mail($to, $subject, $body, $headers)) {
52 $message = $LANG['Sendmail_result_error'];
54 $message = $LANG['Sendmail_result_succes'];
58 include './templates/header.tpl';
59 include './templates/menu.tpl';
60 include './templates/sendmail.tpl';
61 include './templates/footer.tpl';