本文整理汇总了PHP中Email::Subject方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::Subject方法的具体用法?PHP Email::Subject怎么用?PHP Email::Subject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email::Subject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Report
public static function Report()
{
$sql = 'SELECT * FROM {{orders}} WHERE loyalty=1 AND sent=0';
$list = DB::getAll($sql);
foreach ($list as $order) {
$sql = '
SELECT * FROM {{orders_items}}
WHERE orders=' . $order['id'] . '
';
$items = DB::getAll($sql);
$data = $order;
foreach ($items as $item) {
$temp = Tree::getInfo($item['tree']);
if ($temp['path'] != 'catalogopt') {
$data['list'][] = Catalog::getOne($item['tree']);
}
}
$text = View::getRenderEmpty('email/report', $data);
$mail = new Email();
$mail->Text($text);
$mail->Subject('Оставьте отзыв о товаре на сайте www.' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->To($order['email']);
$mail->Send();
$sql = '
UPDATE {{orders}}
SET sent=1
WHERE id=' . $order['id'] . '
';
DB::exec($sql);
}
}
示例2: send
public static function send($id)
{
foreach ($_POST as $key => $value) {
$_POST[$key] = htmlspecialchars(trim(strip_tags($value)));
}
if ($_SESSION['captcha_keystring'] == $_POST['kcaptcha'] && $_SESSION['captcha_keystring'] != '') {
$text = '';
foreach ($_POST as $name => $item) {
if ($_POST[$name . '_text'] && strpos($name, '_text') === false) {
if (strpos($name, '_area') !== false) {
$text .= '<b>' . $_POST[$name . '_text'] . ':</b> <br />' . nl2br($item) . '<br />';
} else {
$text .= '<b>' . $_POST[$name . '_text'] . ':</b> ' . $item . '<br />';
}
}
}
$mail = new Email();
$info = Tree::getInfo($id);
if (Funcs::$conf['mail'][$info['path']]) {
$mail->To(Funcs::$conf['mail'][$info['path']]);
} elseif (Funcs::$conf['settings']['email']) {
$mail->To(Funcs::$conf['settings']['email']);
} else {
return false;
}
$mail->Subject($_POST['subject'] . ' на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
return true;
} else {
return false;
}
}
示例3: addMessage
public static function addMessage($touser, $message)
{
$sql = '
INSERT INTO {{messages}}
SET
fromuser=' . $_SESSION['iuser']['id'] . ',
touser=' . $touser . ',
message=\'' . $message . '\',
cdate=NOW()
';
DB::exec($sql);
$sql = 'SELECT CONCAT(fname,\' \',lname) AS name, email FROM {{iusers}} WHERE id=' . $touser . '';
$row = DB::getRow($sql);
$toname = $row['name'];
$email = $row['email'];
if (trim($toname) == '') {
$toname = 'Неизвестный';
}
$text = '
Здравствуйте, ' . $toname . '!<br /><br />
' . $_SESSION['iuser']['name'] . ' написал Вам новое сообщение на сайте <a href="http://' . $_SERVER['HTTP_HOST'] . '">' . $_SERVER['HTTP_HOST'] . '</a>.<br /><br />
';
$text = View::getRenderEmpty('email/simple', array('text' => $text, 'title' => 'Новое сообщение'));
$mail = new Email();
$mail->To($email);
$mail->Subject('Новое сообщение от ' . $_SESSION['iuser']['name'] . ' на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
}
示例4: forgot
function forgot()
{
if ($_POST) {
DB::escapePost();
$sql = '
SELECT * FROM {{users}} WHERE login=\'' . $_POST['login'] . '\'
';
$return = DB::getRow($sql);
if ($return) {
$pass = Funcs::generate_password(8);
$sql = '
UPDATE {{users}}
SET pass=MD5(\'' . $pass . '\')
WHERE login=\'' . $_POST['login'] . '\'
';
DB::exec($sql);
$text = '
Здравствуйте, ' . $return["login"] . '.<br />
Ваш новый пароль ' . $pass . '.<br />
Сменить пароль Вы можете в личном кабинете.
';
$mail = new Email();
$mail->To($return['email']);
$mail->Subject('Восстановление пароля на сайте www.' . str_replace("www.", "", $_SERVER["HTTP_HOST"]));
$mail->Text($text);
$mail->Send();
}
$this->redirect('/');
} else {
View::$layout = 'empty';
View::render('site/forgot');
}
}
示例5: send
private static function send($address, $subject, $text)
{
$mail = new Email();
$mail->To($address);
$mail->Subject($subject);
$mail->Text($text);
$mail->Send();
}
示例6: send
function send()
{
$emails = array();
$groups = array();
if (!isset($_POST['users']) and !isset($_POST['email'])) {
return;
}
$sqlGroups = '';
if (!empty($_POST['users'])) {
foreach ($_POST['users'] as $item) {
if ($item == 'iusers') {
$sql = 'SELECT email FROM {{iusers}} WHERE visible=1';
$emails = array_merge($emails, DB::getAll($sql, 'email'));
} elseif ($item == 'subscribers') {
$sql = 'SELECT email FROM {{subscribers}}';
$emails = array_merge($emails, DB::getAll($sql, 'email'));
} elseif ($item == 'orders') {
$sql = 'SELECT email FROM {{orders}}';
$emails = array_merge($emails, DB::getAll($sql, 'email'));
} else {
$groups[] = $item;
}
}
$sqlGroups = 'emailgroups=\'' . implode(',', $_POST['users']) . '\',';
}
if (!empty($groups)) {
$users = Iuser::getGroupUsers($groups, 'email');
$emails = array_merge($emails, $users);
}
$emails[] = $_POST['email'];
$emails = array_unique($emails);
$text = View::getRenderFullEmpty('email/notifications', array('text' => $_POST['body'], 'title' => $_POST['subject']));
foreach ($emails as $email) {
$mail = new Email();
$mail->Text($text);
$mail->Subject($_POST['subject']);
$mail->From($_POST['emailfrom']);
$mail->mailTo($email);
$mail->Send();
}
$sql = '
INSERT INTO {{notification}}
SET
subject=\'' . $_POST['subject'] . '\',
body=\'' . $_POST['body'] . '\',
email=\'' . implode(',', $emails) . '\',
' . $sqlGroups . '
emailfrom=\'' . $_POST['emailfrom'] . '\',
cdate=NOW(),
author=' . $_SESSION['user']['id'] . '
';
DB::exec($sql);
}
示例7: sendAllOrder
public static function sendAllOrder($id)
{
$data = Orders::getOrderById($id);
View::$layout = 'empty';
$text = View::getRenderFullEmpty('email/order', $data);
$mail = new Email();
$mail->mailTo($data['email']);
$mail->Subject('Статус заказа №' . (str_repeat('0', 6 - strlen($id)) . $id) . ' на сайте ' . $_SERVER['HTTP_HOST'] . ' изменен');
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->Text($text);
$mail->Send();
}
示例8: sendMailback
public function sendMailback()
{
DB::escapePost();
$text .= '<b>Имя:</b> ' . $_POST['name'] . '<br />';
$text .= '<b>Телефон:</b> ' . $_POST['phone'] . '<br />';
$text .= '<b>Email:</b> ' . $_POST['email'] . '<br />';
$text .= '<b>Сообщение:</b> ' . nl2br($_POST['message']) . '<br />';
View::$layout = 'empty';
$text = View::getRender('email/callback', array('text' => $text));
$mail = new Email();
$mail->mailTo(Funcs::$conf['email']['callback']);
$mail->Subject('Обратная связь на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
}
示例9: ask
public function ask($tree)
{
foreach ($_POST as $key => $value) {
$_POST[$key] = htmlspecialchars(trim(strip_tags($value)));
}
if ($_POST['kcaptcha'] == $_SESSION['captcha_keystring'] && $_POST['kcaptcha'] != '' && $_SESSION['captcha_keystring'] != '') {
$sql = '
INSERT INTO {{tree}}
SET
parent=' . $tree . ',
name=\'' . trim($_POST['question']) . '\',
path=\'' . Funcs::Transliterate(trim($_POST['question'])) . '\',
seo_title=\'' . trim($_POST['question']) . '\',
seo_keywords=\'' . trim($_POST['question']) . '\',
seo_description=\'' . trim($_POST['question']) . '\',
udate=NOW(),
cdate=NOW(),
visible=0,
site=' . $_SESSION['site'] . ',
num=0
';
$id = DB::exec($sql);
$sql = '
INSERT INTO {{relations}}
SET
modul1=\'tree\',
modul2=\'faq\',
id1=\'' . $id . '\',
id2=1,
cdate=NOW()
';
DB::exec($sql);
//Fields::insertField($id,'answer',$_POST['message']);
//Fields::insertField($id,'phone',$_POST['phone']);
$text = '
<b>Email:</b> <a href="mailto:' . trim($_POST['email']) . '">' . trim($_POST['email']) . '</a><br />
<b>Вопрос:</b> ' . trim($_POST['question']) . '<br />
';
$mail = new Email();
$mail->To(Funcs::$conf['email']['faq']);
$mail->Subject('Задан вопрос на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
return false;
} else {
return true;
}
}
示例10: send
public function send()
{
$form = $this->getForm(Funcs::$uri[1]);
$text = '';
foreach ($this->getFields(Funcs::$uri[1]) as $item) {
if ($item['type'] == 'text') {
$text .= '<b>' . $item['name'] . '</b><br /> ' . nl2br($_POST[$item['path']]) . '<br />';
} elseif ($item['type'] == 'checkbox') {
if ($_POST[$item['path']]) {
$text .= '<b>' . $item['name'] . '</b><br />';
}
} else {
$text .= '<b>' . $item['name'] . '</b> ' . $_POST[$item['path']] . '<br />';
}
}
$mail = new Email();
$mail->mailTo($form["email"]);
$mail->Subject($form['theme']);
$mail->Text($text);
$mail->Send();
}
示例11: sendMessage
public function sendMessage()
{
Funcs::escapePost();
//if($_POST['kcaptcha']==$_SESSION['captcha_keystring'] && $_POST['kcaptcha']!='' && $_SESSION['captcha_keystring']!=''){
$text = '
<b>ФИО:</b> ' . $_POST['fio'] . '<br />
<b>Телефон:</b> ' . $_POST['tel'] . '<br />
<b>Email:</b> <a href="mailto:' . $_POST['email'] . '">' . $_POST['email'] . '</a><br />
<b>Тема:</b> ' . $_POST['theme'] . '<br />
<b>Сообщение:</b><br />' . nl2br($_POST['quest']) . '<br />
';
$mail = new Email();
$mail->To(Funcs::$conf['email']['feedback']);
$mail->Subject('Обратная связь на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
return false;
/*}else{
return true;
}*/
}
示例12: toOrder
function toOrder($iuserId = 0, $id = '', $send = true)
{
if ($id == '') {
$id = $this->saveBasket();
}
View::$layout = 'empty';
$data = $this->getOrder();
$data['id'] = $id;
$data['hits'] = Index::getHits();
$text = View::getRender('basket/mail', $data);
$textadmin = View::getRender('basket/mailadmin', $data);
$info = View::getRender('basket/mailinfo');
$code = '';
/*if($info!='Наличными'){
$_SESSION['code']=rand(1,9999);
$code='<br /><br /><b>Код подтверждения:<b/> '.$_SESSION['code'];
}*/
$this->saveBasket($id, $text, $data, $info, $iuserId);
if ($send) {
$mail = new Email();
$mail->Text($textadmin);
$mail->Subject('Поступил заказ с сайта www.' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->To(Funcs::$conf['email']['order']);
$mail->Send();
if ($_SESSION['mydata']['email']) {
$data['client'] = 1;
$text = View::getRender('basket/mail', $data);
$info = View::getRender('basket/mailinfo');
$mail = new Email();
$mail->Text($text);
$mail->Subject('Вы оставили заказ на сайте www.' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->mailTo($_SESSION['mydata']['email']);
$mail->Send();
}
}
if (SMSuser) {
file_get_contents('http://sms.spb.su/sms.cgi?user=' . SMSuser . '&pass=' . SMSpass . '&phone=' . Funcs::$conf['additional']['sms'] . '&flash=0&message=' . urlencode(iconv('utf-8', 'windows-1251', 'Заказ ' . $id . ' ' . $_SESSION['mydata']['name'] . ' ' . $_SESSION['mydata']['phone'])) . '&from=' . $_SERVER['HTTP_HOST'] . '');
}
$_SESSION['mydata'] = array();
$_SESSION['goods'] = array();
$_SESSION['orderId'] = $id;
}
示例13: setSubscribers
public static function setSubscribers()
{
DB::escapePost();
$sql = 'SELECT email FROM {{subscribers}} WHERE email=\'' . $_POST["email"] . '\'';
$email = DB::getOne($sql);
if ($email) {
$text .= '<b>Здравствуйте!</b><br />Вы уже зарегистрированы на подписку<br /><br />';
$text .= 'Для отказа от подписки пройдите по ссылке <a href="http://' . $_SERVER['HTTP_HOST'] . '/confirm/' . md5(News::$delsalt . $email) . '">http://' . $_SERVER['HTTP_HOST'] . '/confirm/' . md5(News::$delsalt . $email) . '</a><br />';
} else {
$sql = '
INSERT INTO {{subscribers}}
SET
email=\'' . $_POST["email"] . '\',
create_date=NOW()
';
DB::exec($sql);
$text .= '<b>Здравствуйте!</b><br />Вы успешно зарегистрированы на подписку на сайте <a href="http://' . $_SERVER['HTTP_HOST'] . '">' . $_SERVER['HTTP_HOST'] . '</a><br /><br />';
$text .= 'Для отказа от подписки пройдите по ссылке <a href="http://' . $_SERVER['HTTP_HOST'] . '/confirm/' . md5(News::$delsalt . $email) . '">http://' . $_SERVER['HTTP_HOST'] . '/confirm/' . md5(News::$delsalt . $email) . '</a><br />';
}
View::$layout = 'empty';
$text = View::getRender('email/newssubscribe', array('text' => $text));
$mail = new Email();
$mail->To($_POST["email"]);
$mail->Subject('Подписка на новости на сайте ' . $_SERVER['HTTP_HOST']);
$mail->Text($text);
$mail->Send();
}
示例14: addNewOrder
public static function addNewOrder($dealerId)
{
DB::escapePost();
$sum = 0;
foreach ($_POST['items'] as $key => $item) {
$sum += $_POST['prices'][$key] * $item;
}
$price = $sum - $sum / 100 * $_SESSION['dealer']['sale'];
//$sql='SELECT * FROM {{dealers_consignee}} WHERE id='.$_POST['cons'].'';
$sql = '
INSERT INTO {{dealers_orders}}
SET
status=1,
price=\'' . $price . '\',
sale=\'' . $sum / 100 * $_SESSION['dealer']['sale'] . '\',
saleperc=\'' . $_SESSION['dealer']['sale'] . '\',
cons=\'' . $_POST['cons'] . '\',
comment=\'' . $_POST['comment'] . '\',
dealer=\'' . $dealerId . '\',
preorder=\'' . $_POST['preorder'] . '\',
cdate=NOW()
';
$orderId = DB::exec($sql);
$dealer = DealersMain::getOne($dealerId);
self::addItemsToOrder($_POST['items'], $orderId, $_POST['prices']);
self::addHistory($orderId, '', 1);
$text = 'Новый заказ № ' . str_repeat('0', 6 - strlen($orderId)) . $orderId . ' поступил от дилера ' . $_SESSION['dealer']['company'] . '';
$mail = new Email();
$mail->Text($text);
$mail->Subject('Поступил заказ от дилера с сайта www.' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->mailTo(Funcs::$conf['email']['dealers']);
$mail->Send();
}
示例15: setReport
public function setReport($id)
{
foreach ($_POST as $key => $value) {
$_POST[$key] = htmlspecialchars(trim(strip_tags($value)));
}
$cbid = 0;
$sql = '
INSERT INTO {{reports}}
SET
`tree`=' . $id . ',
`name`=\'' . $_POST['name'] . '\',
`email`=\'' . $_POST['email'] . '\',
`report`=\'' . $_POST['report'] . '\',
`stars`=' . $_POST['stars'] . ',
`create_date`=NOW()
';
DB::exec($sql);
$sql = 'SELECT * FROM {{reports}} WHERE tree=' . $id . '';
$list = DB::getAll($sql);
$count = count($list);
$sum = 0;
foreach ($list as $item) {
$sum += $item['stars'];
}
$rating = round($sum / $count);
$sql = '
UPDATE {{catalog}}
SET rating=' . $rating . '
WHERE tree=' . $id . '
';
DB::exec($sql);
$path = Tree::getPathToTree($id);
$text = View::getRenderEmpty('email/adminreport', array('path' => $path));
$mail = new Email();
$mail->Text($text);
$mail->Subject('Оставлен отзыв на сайте www.' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->From('robot@' . str_replace('www.', '', $_SERVER["HTTP_HOST"]));
$mail->mailTo(Funcs::$conf['email']['report']);
$mail->Send();
}