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


PHP YiiMailMessage::addBcc方法代码示例

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


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

示例1: actionSendReminderEmails

 /**
  * Send reminder emails to those who haven't paid for their next week's box
  */
 public function actionSendReminderEmails()
 {
     $Customers = Customer::model()->findAllWithNoOrders();
     foreach ($Customers as $Cust) {
         $validator = new CEmailValidator();
         if ($validator->validateValue(trim($Cust->User->email))) {
             $User = $Cust->User;
             $User->auto_login_key = $User->generatePassword(50, 4);
             $User->update_time = new CDbExpression('NOW()');
             $User->update();
             $adminEmail = SnapUtil::config('boxomatic/adminEmail');
             $adminEmailFromName = SnapUtil::config('boxomatic/adminEmailFromName');
             $message = new YiiMailMessage('Running out of orders');
             $message->view = 'customer_running_out_of_orders';
             $message->setBody(array('Customer' => $Cust, 'User' => $User), 'text/html');
             $message->addTo($Cust->User->email);
             $message->addBcc($adminEmail);
             //$message->addTo('francis.beresford@gmail.com');
             $message->setFrom(array($adminEmail => $adminEmailFromName));
             if (!@Yii::app()->mail->send($message)) {
                 echo '<p style="color:red"><strong>Email failed sending to: ' . $Cust->User->email . '</strong></p>';
             } else {
                 echo '<p>Running out of orders message sent to: ' . $Cust->User->email . '</p>';
             }
         } else {
             echo '<p style="color:red"><strong>Email not valid: "' . $Cust->User->email . '"</strong></p>';
         }
     }
     echo '<p><strong>Finished.</strong></p>';
     //Yii::app()->end();
 }
开发者ID:snapfrozen,项目名称:boxomatic,代码行数:34,代码来源:CronController.php

示例2: actionForgot

 public function actionForgot()
 {
     $message = "";
     // TODO: Sanitize input!!!
     if (isset($_POST['email'])) {
         $email = $_POST['email'];
         // TODO: See if user's email address exists in database
         $customer = Customer::model()->findByAttributes(array('bilemail' => $email));
         if ($customer != null) {
             // Send user's password to client
             $message = new YiiMailMessage();
             $message->view = 'template';
             $message->setBody(array('include' => 'forgot-password.php', 'customer' => $customer), 'text/html');
             $message->addTo($customer->bilemail);
             $message->addBcc("psam@saipeople.com");
             $message->addFrom(Yii::app()->params['adminEmail']);
             $message->setSubject("Password Request");
             Yii::app()->mail->send($message);
             $message = "Email sent.";
         } else {
             $message = "Email address not found.";
         }
     }
     $this->render('forgotpassword', array('message' => $message));
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:25,代码来源:UserController.php


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