コード例 #1
0
ファイル: mail.php プロジェクト: Nozlaf/WeBid
     $userarray = $db->result();
     // check use mailbox insnt full
     $query = "SELECT * FROM " . $DBPrefix . "messages WHERE sentto = :user_id";
     $params = array();
     $params[] = array(':user_id', $userarray['id'], 'int');
     $db->query($query, $params);
     if ($db->numrows() >= $mailbox_space) {
         $_SESSION['message'] = sprintf($MSG['443'], $sendto);
         header('location: mail.php');
         exit;
     }
 } else {
     // send the email
     $emailer = new email_handler();
     $from_email = $system->SETTINGS['users_email'] == 'n' ? $user->user_data['email'] : $system->SETTINGS['adminmail'];
     $emailer->email_basic($subject, $sendto, $nowmessage, $from_email);
 }
 // send message
 $id_type = $email ? 'fromemail' : 'sentto';
 $query = "INSERT INTO " . $DBPrefix . "messages (" . $id_type . ", sentfrom, message, subject, reply_of, question)\n\t\t\tVALUES (:to_ids, :sender_id, :nowmessages, :subjects, :reply_of_hash, :question_hash)";
 $params = array();
 $params[] = array(':to_ids', $email ? $sendto : $userarray['id'], 'bool');
 $params[] = array(':sender_id', $user->user_data['id'], 'int');
 $params[] = array(':nowmessages', $nowmessage, 'str');
 $params[] = array(':subjects', $subject, 'str');
 $params[] = array(':reply_of_hash', $_SESSION['reply_of' . $_POST['hash']], 'int');
 $params[] = array(':question_hash', $_SESSION['question' . $_POST['hash']], 'int');
 $db->query($query, $params);
 // Track IP
 if (defined('TrackUserIPs')) {
     $system->log('user', 'Post Private Message', $user->user_data['id'], $db->lastInsertId());
コード例 #2
0
ファイル: emailsettings.php プロジェクト: Nozlaf/WeBid
        $INFO = $MSG['email_settings_updated'];
    }
}
$selectsetting = isset($system->SETTINGS['mail_protocol']) ? $system->SETTINGS['mail_protocol'] : '0';
loadblock($MSG['1119'], '', generateSelect('mail_protocol', $mail_protocol));
loadblock($MSG['1120'], '<span class="non_smtp para">' . $MSG['1121'], 'text', 'mail_parameter', $system->SETTINGS['mail_parameter']);
loadblock($MSG['1133'] . '<span class="smtp"></span>' . $MSG['1141'], '', '', '', '', array(), true);
loadblock($MSG['1128'], '<span class="smtp"></span>', 'yesno', 'smtp_authentication', $system->SETTINGS['smtp_authentication'], array($MSG['yes'], $MSG['no']));
$selectsetting = isset($system->SETTINGS['smtp_security']) ? $system->SETTINGS['smtp_security'] : 'none';
loadblock($MSG['1127'], '<span class="smtp"></span>', generateSelect('smtp_security', $smtp_secure_options));
loadblock($MSG['1126'], '<span class="smtp"></span>', 'text', 'smtp_port', $system->SETTINGS['smtp_port']);
loadblock($MSG['1124'], '<span class="smtp"></span>', 'text', 'smtp_username', $system->SETTINGS['smtp_username']);
loadblock($MSG['1125'], '<span class="smtp"></span>', 'text', 'smtp_password', $system->SETTINGS['smtp_password']);
loadblock($MSG['1122'], '<span class="smtp"></span>', 'text', 'smtp_host', $system->SETTINGS['smtp_host']);
loadblock($MSG['1129'], sprintf($MSG['1130'], $system->SETTINGS['adminmail']), 'text', 'alert_emails', $system->SETTINGS['alert_emails']);
$mail_info2 = '';
// send test email
if (isset($_GET['test_email'])) {
    $user_name = filter_var($_POST["user_name"], FILTER_SANITIZE_STRING);
    $to_email = filter_var($_POST["user_email"], FILTER_SANITIZE_EMAIL);
    $subject = filter_var($_POST["subject"], FILTER_SANITIZE_STRING);
    $message = filter_var($_POST["message"], FILTER_SANITIZE_STRING);
    $emailer = new email_handler();
    $emailer->email_basic($subject, $to_email, $message);
    die;
}
$template->assign_vars(array('SITEURL' => $system->SETTINGS['siteurl'], 'TYPENAME' => $MSG['524'], 'PAGENAME' => $MSG['1131'], 'MAIL_PROTOCOL' => $mail_protocol[$system->SETTINGS['mail_protocol']], 'SMTP_AUTH' => $system->SETTINGS['smtp_authentication'], 'SMTP_SEC' => $system->SETTINGS['smtp_security'], 'SMTP_PORT' => !empty($system->SETTINGS['smtp_port']) && is_numeric($system->SETTINGS['smtp_port']) ? $system->SETTINGS['smtp_port'] : 25, 'SMTP_USER' => $system->SETTINGS['smtp_username'], 'SMTP_PASS' => $system->SETTINGS['smtp_password'], 'SMTP_HOST' => $system->SETTINGS['smtp_host'], 'ALERT_EMAILS' => $system->SETTINGS['alert_emails'], 'ADMIN_EMAIL' => $system->SETTINGS['adminmail']));
include 'header.php';
$template->set_filenames(array('body' => 'emailsettings.tpl'));
$template->display('body');
include 'footer.php';
コード例 #3
0
        $query = "SELECT title FROM " . $DBPrefix . "auctions WHERE id = :auction_id";
        $params = array();
        $params[] = array(':auction_id', $auction_id, 'int');
        $db->query($query, $params);
        if ($db->numrows() == 0) {
            $ERR = $ERR_622;
        } else {
            $item_title = $db->result('title');
            $item_title = $system->uncleanvars($item_title);
            $from_email = $system->SETTINGS['users_email'] == 'n' ? $user->user_data['email'] : $system->SETTINGS['adminmail'];
            // Send e-mail message
            $subject = $MSG['335'] . ' ' . $system->SETTINGS['sitename'] . ' ' . $MSG['336'] . ' ' . $item_title;
            $message = $MSG['084'] . ' ' . $MSG['240'] . ': ' . $from_email . "\n\n" . $_POST['TPL_text'];
            $emailer = new email_handler();
            $emailer->email_uid = $user_id;
            $emailer->email_basic($subject, $email, nl2br($message), $user->user_data['name'] . '<' . $from_email . '>');
            //send the email :D
            // send a copy to their mesasge box
            $nowmessage = nl2br($system->cleanvars($message));
            $query = "INSERT INTO " . $DBPrefix . "messages (sentto, sentfrom, sentat, message, subject)\n\t\t\t\t\tVALUES (:id, :user_id, :times, :nowmessage, :msg)";
            $params = array();
            $params[] = array(':id', $user_id, 'int');
            $params[] = array(':user_id', $user->user_data['id'], 'int');
            $params[] = array(':times', time(), 'int');
            $params[] = array(':nowmessage', $nowmessage, 'str');
            $params[] = array(':msg', $system->cleanvars(sprintf($MSG['651'], $item_title)), 'str');
            $db->query($query, $params);
            $sent = true;
        }
    }
}