• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP YiiMailMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: recover

 /**
  * Envia e-mail de recuperação de senha 
  */
 public function recover()
 {
     if (!$this->validate()) {
         return false;
     }
     $usuario = Usuario::model()->ativos()->find("email = ?", array($this->email));
     if ($usuario == null) {
         $this->addError('email', Yii::t('RecuperarSenhaForm', 'Este e-mail está incorreto ou não está cadastrado.'));
         return false;
     }
     $usuario->geraTokenRecuperacaoSenha();
     $assunto = 'Recuperação de senha';
     $view = Yii::app()->controller->renderFile(Yii::getPathOfAlias('application.views.mail') . '/recuperarSenha.php', array('usuario' => $usuario), true);
     $email = new YiiMailMessage();
     $email->view = "template";
     $email->setBody(array('content' => $view, 'title' => $assunto), 'text/html');
     $email->subject = $assunto;
     $email->addTo($this->email);
     $email->from = Yii::app()->params['adminEmail'];
     try {
         Yii::app()->mail->send($email);
     } catch (Exception $e) {
         Yii::log('Erro ao enviar o e-mail:  ' . $e->getMessage(), CLogger::LEVEL_ERROR);
         return false;
     }
     return true;
 }
开发者ID:BrunoCheble,项目名称:novopedido,代码行数:30,代码来源:RecuperarSenhaForm.php


示例2: actionCompleteRegistrationAjax

 public function actionCompleteRegistrationAjax()
 {
     $client = new Client();
     $client->attributes = $_POST['Client'];
     if ($client->save()) {
         $drive = new Drive();
         $drive->attributes = $_POST['Drive'];
         $drive->client_id = $client->primaryKey;
         $drive->creation_date = date("Y-m-d H:i:s");
         if ($drive->save()) {
             $driv = Drive::model()->findByPk($drive->primaryKey);
             $message = new YiiMailMessage();
             $message->view = 'pruebamanejo';
             $message->setBody(array("client" => $client, "drive" => $driv), 'text/html');
             $message->setSubject('Solicitud Prueba de Manejo');
             foreach ($driv->concessioner->emails as $email) {
                 // if($email->type=="DRIVE"){
                 if ($email->type == "QUOTATION") {
                     $message->addTo($email->description);
                 }
             }
             //          		$message->addTo("[email protected]");
             //				$message->addTo("[email protected]");
             $message->addTo("[email protected]");
             $message->addTo("[email protected]");
             $message->setFrom(array(Yii::app()->params['adminEmail'] => 'El Equipo Nissan Ecuador'));
             Yii::app()->mail->send($message);
             echo json_encode(true);
         } else {
             echo json_encode(false);
         }
     }
 }
开发者ID:frankpaul142,项目名称:nissan-modulos,代码行数:33,代码来源:DefaultController.php


示例3: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $message = new YiiMailMessage();
     //this points to the file test.php inside the view path
     $message->view = "login";
     $params = array('name' => '[email protected]');
     $message->subject = 'My TestSubject';
     $message->setBody($params, 'text/html');
     $message->addTo('[email protected]');
     $message->from = '[email protected]';
     //Yii::app()->mail->send($message);
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $login_model = new LoginForm();
     $sign_model = new User();
     // if it is ajax validation request
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
         echo CActiveForm::validate($login_model);
         Yii::app()->end();
     }
     // collect user input data
     if (isset($_POST['LoginForm'])) {
         $login_model->attributes = $_POST['LoginForm'];
         // validate user input and redirect to the previous page if valid
         if ($login_model->validate() && $login_model->login()) {
             $this->redirect(Yii::app()->user->returnUrl);
         }
     }
     // display the login form
     $this->render('index', array('login_model' => $login_model, 'sign_model' => $sign_model));
 }
开发者ID:FavorMylikes,项目名称:RescurimentManager,代码行数:35,代码来源:SiteController.php


示例4: actionRemind

 public function actionRemind()
 {
     if (!Yii::app()->user->isGuest) {
         $this->redirect('/cabinet/');
     }
     $user = new User('pass');
     $user = User::model()->find('email=:email', array(':email' => $_POST['User']['email']));
     $this->performAjaxValidation($user);
     if (isset($_POST['User'])) {
         $chars = "123456789abcdefghijklmnopqrstuvwxyz";
         $num_chars = strlen($chars);
         $char = $chars[rand(0, $num_chars - 1)];
         for ($i = 1; $i < 6; $i++) {
             $char .= $chars[rand(0, $num_chars - 1)];
         }
         $user->password = $char;
         if ($user->save()) {
             $text = "На ваш E-mail был отправлен запрос восстановления пароля:<br /><br /><b>Ваш новый пароль:</b> " . $char . "<br /><br />Администрация Комплекс Бар.";
             $message = new YiiMailMessage();
             $message->setTo(array($user->email => $user->name . ' ' . $user->lastname));
             $message->setFrom(array('[email protected]' => 'Комплекс Бар'));
             $message->setSubject('Новый пароля для сайта Complexbar.ru');
             $message->setBody($text, 'text/html', 'utf8');
             Yii::app()->mail->send($message);
             $this->redirect('/auth/?remind');
         } else {
             exit(var_dump($user->getErrors()));
         }
     }
     $data = array();
     $this->render('/users/auth', $data);
 }
开发者ID:parxtan,项目名称:gdeskidki,代码行数:32,代码来源:UsersController.php


示例5: actionSendMail

 public function actionSendMail()
 {
     if (!empty($_POST)) {
         Yii::import('ext.yii-mail.YiiMailMessage');
         $message = new YiiMailMessage();
         $message->setBody($_POST['content']);
         $message->subject = $_POST['subject'];
         $message->from = $_POST['email'];
         $message->to = Yii::app()->params['adminEmail'];
         if (Yii::app()->mail->send($message)) {
             $model = new Comments();
             $model->title = $_POST['subject'];
             $model->content = $_POST['content'];
             $model->email = $_POST['email'];
             $model->name = $_POST['fullName'];
             $model->phone = $_POST['phone'];
             $model->created = time();
             if ($model->save()) {
                 return jsonOut(array('error' => false, 'message' => 'Cảm ơn bạn đã gửi thông tin, chúng tôi sẽ phản hồi cho bạn trong thời gian sớm nhất!'));
             } else {
                 return json_encode(array('error' => true, 'message' => 'Lỗi hệ thống, gửi thông tin không thành công.'));
             }
         } else {
             return json_encode(array('error' => true, 'message' => 'Gửi thông tin không thành công'));
         }
     }
 }
开发者ID:phiphi1992,项目名称:fpthue,代码行数:27,代码来源:ContactController.php


示例6: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate($id)
 {
     if (!empty($id) && !Yii::app()->user->isGuest) {
         $customer_email = Yii::app()->user->name;
         $customerModel = Customer::model()->findByAttributes(array('customer_email' => $customer_email));
         $productId = $id;
         $productModel = Product::model()->findByPk($productId);
         $model = new Order();
         $model->order_product_id = $productModel->product_id;
         $model->order_customer_id = $customerModel->customer_id;
         $model->order_amount = $productModel->product_price + $productModel->product_shipping_price;
         if ($model->save()) {
             $attribuits = Order::model()->findByPk($model->order_id);
             $str = "Product Name:{$productModel->product_name}\r\n" . "Order Id:{$attribuits->order_id}\r\n" . "Order Product Id:{$attribuits->order_product_id}\r\n" . "Order Customer Id:{$attribuits->order_customer_id}\r\n" . "Total Amount With Shipping Charges:{$attribuits->order_amount}\r\n";
             $message = new YiiMailMessage();
             $message->subject = "Your order details";
             $message->setBody($str);
             $message->addTo(Yii::app()->user->name);
             $message->from = $customerModel->customer_email;
             Yii::app()->mail->send($message);
             $this->redirect(array('view', 'id' => $model->order_id));
         } else {
             echo "booking failed";
         }
     }
 }
开发者ID:pmswamy,项目名称:training2demo,代码行数:30,代码来源:OrderController.php


示例7: send

 /**
  *
  * 邮件发送方法
  * @param string $email 邮件发送地址
  * @param string $subject 邮件发送标题
  * @param string $body 邮件发送内容
  */
 public static function send($email, $subject, $body)
 {
     $message = new YiiMailMessage();
     $message->setBody($body, 'text/html');
     $message->subject = $subject;
     $message->addTo($email);
     $message->setFrom(array('[email protected]' => "萤火虫"));
     return Yii::app()->mail->send($message);
 }
开发者ID:niujie123,项目名称:myself,代码行数:16,代码来源:FMail.php


示例8: actionEmail1

 public function actionEmail1()
 {
     $message = new YiiMailMessage();
     $message->setBody('Message content here with HTML', 'text/html');
     $message->subject = 'My Subject';
     $message->addTo('[email protected]');
     $message->from = Yii::app()->params['adminEmail'];
     Yii::app()->mail->send($message);
 }
开发者ID:kit9,项目名称:ERP_Accounting_Indonesia,代码行数:9,代码来源:SReportController.php


示例9: SendMail

 public function SendMail($email = "", $subject = '', $message = "")
 {
     $mail = new YiiMailMessage();
     $mail->setBody($message, 'text/html');
     $mail->subject = $subject;
     $mail->addTo($email);
     $mail->from = Yii::app()->params['regEmail'];
     $mail->setFrom(array('[email protected]' => 'Столица Скидок'));
     return Yii::app()->mail_reg->send($mail);
 }
开发者ID:kirians,项目名称:sf,代码行数:10,代码来源:Vladimir_Yii_ModerationController.php


示例10: enviar

 public function enviar()
 {
     $message = new YiiMailMessage();
     $message->from = $this->email;
     $message->addTo(Yii::app()->params['adminEmail']);
     $message->subject = $this->subject;
     $message->view = "template";
     $view = Yii::app()->controller->renderFile(Yii::getPathOfAlias('application.modules.pizzaria.views.mail') . '/contato.php', array('de' => $this->name, 'email' => $this->email, 'mensagem' => $this->message), true);
     $message->setBody(array('content' => $view, 'title' => $this->subject), 'text/html');
     return Yii::app()->mail->send($message) ? true : false;
 }
开发者ID:BrunoCheble,项目名称:novopedido,代码行数:11,代码来源:Contato.php


示例11: SendMail

 /**
  * @author softdev
  * @param string $subject
  * @param string $email
  * @param array $param
  * @param string $view
  */
 public function SendMail($subject = '', $email, $param, $link = '', $view)
 {
     $message = new YiiMailMessage();
     //this points to the file test.php inside the view path
     $message->view = trim($view);
     $params = array('params' => $param, 'link' => $_SERVER['HTTP_ORIGIN'] . $link);
     $message->subject = $subject;
     $message->setBody($params, 'text/html');
     $message->addTo(trim($email));
     $message->from = Yii::app()->params['adminEmail'];
     Yii::app()->mail->send($message);
 }
开发者ID:limmer3,项目名称:instagress,代码行数:19,代码来源:FController.php


示例12: sendEmail

 public function sendEmail()
 {
     $this->checkEmailConditions();
     Yii::import('application.extensions.yii-mail.YiiMailMessage');
     $message = new YiiMailMessage();
     $message->setSubject($this->emailSubject);
     $message->view = $this->emailViewFile;
     $message->setBody($this->emailParams, 'text/html');
     $message->setTo($this->receiverEmail);
     $message->from = $this->senderEmail;
     return Yii::app()->mail->send($message);
 }
开发者ID:andrelinoge,项目名称:rezydent,代码行数:12,代码来源:ContactForm.php


示例13: sendSenderNotification

 /**
  * Send notification for user, that has sent message for administration
  * @return mixed
  */
 public function sendSenderNotification()
 {
     $this->checkNotificationCondition();
     Yii::import('application.extensions.yii-mail.YiiMailMessage');
     $senderNotification = new YiiMailMessage();
     $senderNotification->setSubject($this->notificationSubject);
     $senderNotification->view = $this->notificationViewFile;
     $senderNotification->setBody($this->notificationParams, 'text/html');
     $senderNotification->setTo($this->notificationReceiver);
     $senderNotification->from = $this->notificationSender;
     return Yii::app()->mail->send($senderNotification);
 }
开发者ID:andrelinoge,项目名称:rezydent,代码行数:16,代码来源:AbstractEmailForm.php


示例14: sendMail

 protected function sendMail($to, $subject, $body, $att = null)
 {
     Yii::import('ext.yii-mail.YiiMailMessage');
     $message = new YiiMailMessage();
     $message->setBody($body);
     $message->subject = $subject;
     $message->addTo($to);
     $message->from = Yii::app()->params['adminEmail'];
     if ($att) {
         $swiftAttachment = Swift_Attachment::fromPath($att);
         $message->attach($swiftAttachment);
     }
     return Yii::app()->mail->send($message);
 }
开发者ID:emisdb,项目名称:cherry,代码行数:14,代码来源:Controller.php


示例15: actionTeste

 public function actionTeste()
 {
     Yii::import('ext.yii-mail.YiiMailMessage');
     $message = new YiiMailMessage();
     $message->setBody('Message content here with HTML', 'text/html');
     $message->subject = 'My Subject';
     $message->addTo('[email protected]');
     $message->from = Yii::app()->params['adminEmail'];
     if (Yii::app()->mail->send($message)) {
         echo 'E-mail enviado com sucesso';
     } else {
         echo 'Falha ao tentar enviar o e-mail';
     }
 }
开发者ID:rhokrecife,项目名称:sosdefesacivil,代码行数:14,代码来源:HelloController.php


示例16: SendMail

 public function SendMail($data, $detail)
 {
     Yii::import('ext.yii-mail.YiiMailMessage');
     $message = new YiiMailMessage();
     $message->view = "price_submission";
     $params = array('data' => $data, 'detail' => $detail);
     $message->setBody($params, 'text/html');
     $message->subject = "Price calculation submission";
     $message->addTo($data->email);
     $message->from = Yii::app()->params['adminEmail'];
     if (Yii::app()->mail->send($message)) {
         return "sukses";
     }
 }
开发者ID:Dvionst,项目名称:vvfy,代码行数:14,代码来源:CalculationHeadController.php


示例17: enviarCorreo

 public function enviarCorreo($idmiembro)
 {
     $miembro = Miembro::model()->findByPk($idmiembro);
     Yii::log('miembro pwd ' . $miembro->password);
     $body = "Sus datos de acceso al sistema de SOMIM son los siguientes:\n";
     $body .= "Dirección de correo electrónico: " . $miembro->email;
     $body .= "Contraseña: " . $miembro->password;
     $message = new YiiMailMessage();
     $message->subject = 'Acceso SOMIM';
     $message->setBody($body, 'text/html');
     $message->addTo($miembro->email);
     $message->from = '[email protected]';
     Yii::app()->mail->send($message);
     return true;
 }
开发者ID:enriqueism,项目名称:app,代码行数:15,代码来源:RecoveryForm.php


示例18: SendMail

 /**
  * $data = array(
  *	'view'=>'mail',
  *	'server'=>'[email protected]',
  *	'data'=>array(
  *		'email'=>'[email protected]'
  *	)
  *);
  *$this->SendMail('[email protected]','asdad',$data,'layout');
  **/
 public function SendMail($mailTo = '', $subject = '', $params = array(), $layout = 'layout')
 {
     if (isset($params['server']) && $params['server'] != '') {
         $mailFrom = $params['server'];
     }
     $message = new YiiMailMessage();
     $message->view = $layout;
     $sid = 1;
     $params = $params;
     $message->subject = $subject;
     //$message->from = $mailFrom;
     $message->setBody($params, 'text/html');
     $message->addTo($mailTo);
     return Yii::app()->mail->send($message);
 }
开发者ID:phiphi1992,项目名称:fpthue,代码行数:25,代码来源:Controller.php


示例19: sendEmail

 public function sendEmail()
 {
     $this->checkEmailConditions();
     Yii::import('application.extensions.yii-mail.YiiMailMessage');
     $message = new YiiMailMessage();
     $message->setSubject($this->subject);
     $message->view = 'mass-delivery';
     $message->setBody(array('text' => $this->text), 'text/html');
     $message->from = Yii::app()->params['emails']['defaultSender'];
     if (is_array($this->receiverEmail)) {
         foreach ($this->receiverEmail as $email) {
             $message->setTo($email);
             Yii::app()->mail->send($message);
         }
     }
     return TRUE;
 }
开发者ID:andrelinoge,项目名称:rezydent,代码行数:17,代码来源:MassDeliveryForm.php


示例20: sendMail

 public static function sendMail($params = array())
 {
     /** @var $message YiiMailMessage */
     $message = new YiiMailMessage();
     /*
     $base_path = Yii::getPathOfAlias('application.views.mail.images');
     $files = CFileHelper::findFiles($base_path);
     $imgs = array();
     foreach ($files as $file) {
         $imgs[basename($file)] = $message->embed(Swift_Image::fromPath($file));
     }
     if(isset($params['params']['attachedFilePath'], $params['params']['attachedFileName'])) {
         $message->attach(Swift_Attachment::fromPath($params['params']['attachedFilePath'])->setFilename($params['params']['attachedFileName']));
     }
     $params['params']['imgs'] = $imgs;
     */
     $message->view = $params['view'];
     $message->subject = $params['subject'];
     $message->setTo($params['to']);
     if (isset($params['cc'])) {
         $message->setCc($params['cc']);
     }
     if (isset($params['bcc'])) {
         $message->setBcc($params['bcc']);
     }
     $message->setBody($params['params'], 'text/html');
     $message->addPart(self::getPlainTextVersion($message, $params['params']), 'text/plain');
     $message->attachSigner(self::getSigner());
     $message->from = Yii::app()->params['mail_sender'];
     return Yii::app()->mail->send($message);
 }
开发者ID:bartaakos,项目名称:yii-shard-poc,代码行数:31,代码来源:Mailer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Yoast_Form类代码示例发布时间:2022-05-23
下一篇:
PHP YiiBase类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap