本文整理汇总了PHP中Email::From方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::From方法的具体用法?PHP Email::From怎么用?PHP Email::From使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email::From方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
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);
}
示例3: 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();
}
示例4: 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;
}
示例5: 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();
}
示例6: 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();
}