当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::mailTo方法代码示例

本文整理汇总了PHP中Email::mailTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::mailTo方法的具体用法?PHP Email::mailTo怎么用?PHP Email::mailTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Email的用法示例。


在下文中一共展示了Email::mailTo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:53,代码来源:NotificationModel.php

示例2: 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();
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:12,代码来源:SendorderModel.php

示例3: 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();
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:15,代码来源:PopupModel.php

示例4: 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();
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:21,代码来源:FormModel.php

示例5: 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;
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:44,代码来源:BasketModel.php

示例6: setAnketa

    public function setAnketa()
    {
        Funcs::escapePost();
        $data = array();
        $text = '';
        foreach (OneSSA::$iuserStandartAdds as $title => $items) {
            $text .= '<h3>' . $title . ':</h3>';
            foreach ($items as $key => $item) {
                if ($item['type'] == 'bool') {
                    $data[$key] = $_POST[$key] == 1 ? '1' : '0';
                    $_POST[$key] = $_POST[$key] == 1 ? 'Да' : 'Нет';
                } else {
                    if ($item['main'] != 1) {
                        $data[$key] = $_POST[$key];
                    }
                }
                $text .= '<b>' . $item['name'] . ':</b> ' . $_POST[$key] . '<br />';
            }
        }
        $pass = Funcs::generate_password(8);
        $address = array();
        foreach (OneSSA::$iuserStandartAdds['1.2 Фактический адрес'] as $key => $item) {
            if ($_POST[$key] != '') {
                $address[] = $_POST[$key];
            }
        }
        if (count($address) > 0) {
            $address = implode(', ', $address);
        } else {
            $address = '';
        }
        $sql = '
			INSERT INTO {{iusers}}
			SET name=\'' . $_POST['name'] . '\',
				phone=\'' . $_POST['phone'] . '\',
				email=\'' . $_POST['email'] . '\',
				pass=\'' . md5($pass) . '\',
				address=\'' . $address . '\',
				visible=0,
				cdate=NOW()
		';
        $id = DB::exec($sql);
        $text .= '<b>Пароль:</b> ' . $pass . '<br />';
        $text .= '<b>Пользователь:</b> ' . $id . '<br />';
        foreach ($data as $key => $item) {
            $sql = '
				INSERT INTO {{iusers_adds}}
				SET iuser=' . $id . ',
					name=\'' . $key . '\',
					string_value=\'' . $_POST[$key] . '\'
			';
            DB::exec($sql);
        }
        $mail = new Email();
        $mail->mailTo(Funcs::$conf['email']['anketa']);
        $mail->Subject('Новая анкета партнера на сайте ' . str_replace("www.", "", $_SERVER["HTTP_HOST"]));
        View::$layout = 'empty';
        $text = View::getRender('email/anketa', array('text' => $text));
        $mail->Text($text);
        $mail->Send();
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:61,代码来源:UserModel.php

示例7: 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();
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:40,代码来源:CatalogModel.php

示例8: 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();
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:34,代码来源:DealersOrdersModel.php


注:本文中的Email::mailTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。