本文整理匯總了PHP中Emails::sendToSystem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Emails::sendToSystem方法的具體用法?PHP Emails::sendToSystem怎麽用?PHP Emails::sendToSystem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Emails
的用法示例。
在下文中一共展示了Emails::sendToSystem方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: User
<?php
$ACCESS_LEVEL = ACCESS_LEVEL_GUEST;
include_once DOC_ROOT . '/includes/authorization.php';
if (AuthController::getInstance()->isAuthorized()) {
$user = new User(Project::getInstance()->getCurUser()->id);
Project::getInstance()->getSmarty()->assign('user', $user);
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'send') {
if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['email']) && !$user->id) {
location($_SERVER['PHP_SELF'], '<p style="color:red; font-weight:bold;">All fields required!</p>');
} else {
include_once LIB_ROOT . '/emails.class.php';
$emailer = new Emails($user->id);
$emailer->from = $_POST['email'];
$emailer->subject = 'From: ' . ($user->id ? $user->login : $emailer->from) . ' -> ' . $_POST['subject'];
$emailer->body = $_POST['message'];
$emailer->sendToSystem();
location($_SERVER['PHP_SELF'], '<p style="color:red; font-weight:bold;">Your message has been sent to the support!</p>');
}
}
Project::getInstance()->showPage('contactus.tpl');