當前位置: 首頁>>代碼示例>>PHP>>正文


PHP YiiMailMessage::addFrom方法代碼示例

本文整理匯總了PHP中YiiMailMessage::addFrom方法的典型用法代碼示例。如果您正苦於以下問題:PHP YiiMailMessage::addFrom方法的具體用法?PHP YiiMailMessage::addFrom怎麽用?PHP YiiMailMessage::addFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在YiiMailMessage的用法示例。


在下文中一共展示了YiiMailMessage::addFrom方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: actionSendStatement

 /**
  *
  */
 public function actionSendStatement($id)
 {
     // Look up customer information
     $customer = Customer::model()->findByPk($id);
     $commande = Commande::model()->findAllByAttributes(array('bilkey' => $id));
     $service_details = Customer::model()->getCustomerServiceDetails($id);
     $shipment_details = Customer::model()->getShipmentsByCustomerBilkeyClient($id);
     // TODO: Make sure these are correct
     $message = new YiiMailMessage();
     $message->view = 'template';
     //userModel is passed to the view
     $message->setBody(array('include' => 'statement.php', 'customer' => $customer, 'commande' => $commande, 'service_details' => $service_details, 'shipment_details' => $shipment_details), 'text/html');
     $message->addTo($customer->bilemail);
     $message->addFrom(Yii::app()->params['adminEmail']);
     $message->setSubject("Statement of Account");
     Yii::app()->mail->send($message);
     $this->redirect(array('update', 'id' => $id));
 }
開發者ID:E-SOFTinc,項目名稱:Mailnetwork_Yii,代碼行數:21,代碼來源:CustomerController.php


注:本文中的YiiMailMessage::addFrom方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。