本文整理汇总了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');