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


PHP CakeEmail::sender方法代码示例

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


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

示例1: _prepareData

 /**
  * Prepares the data array.
  * Adds headers and content
  *
  * @return void 
  */
 protected function _prepareData()
 {
     $this->_data = array();
     if (count($this->_cakeEmail->cc()) > 0) {
         throw new CakeException('Postageapp transport does not support cc');
     }
     if (count($this->_cakeEmail->bcc()) > 0) {
         throw new CakeException('Postageapp transport does not support bcc');
     }
     if (count($this->_cakeEmail->sender()) > 0) {
         throw new CakeException('Postageapp transport does not support sender');
     }
     $headers = $this->_cakeEmail->getHeaders(array('from', 'sender', 'replyTo', 'returnPath', 'to', 'subject'));
     $this->_data['recipients'] = $headers['To'];
     $map = array('From', 'Subject', 'Reply-To', 'X-Mailer', 'MIME-Version', 'Content-Transfer-Encoding');
     foreach ($map as $header) {
         if (!empty($headers[$header])) {
             $this->_addHeader($header, $headers[$header]);
         }
     }
     $emailFormat = $this->_cakeEmail->emailFormat();
     if ($emailFormat == 'both' || $emailFormat == 'text') {
         $this->_data['content']['text/plain'] = $this->_cakeEmail->message('text');
     }
     if ($emailFormat == 'both' || $emailFormat == 'html') {
         $this->_data['content']['text/html'] = $this->_cakeEmail->message('html');
     }
 }
开发者ID:jellehenkens,项目名称:CakeEmailTransports,代码行数:34,代码来源:PostageappTransport.php

示例2: __sendReminderMail

 private function __sendReminderMail($email_address)
 {
     $from = Configure::read('RentSquare.supportemail');
     $email = new CakeEmail();
     $email->domain('rentsquaredev.com');
     $email->sender('noreply@rentsquaredev.com', 'RentSquare Support');
     $email->template('reminder', 'generic')->emailFormat('html')->from(array($from => 'RentSquare Support'))->to($email_address)->subject('RentSquare Signup Reminder')->send();
     return true;
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:9,代码来源:SendReminderShell.php

示例3: __sendPaymentSuccess

 private function __sendPaymentSuccess($email_address, $email_data)
 {
     $from = Configure::read('RentSquare.supportemail');
     $email = new CakeEmail();
     $email->config('default');
     $email->domain('rentsquaredev.com');
     $email->sender('noreply@rentsquaredev.com', 'RentSquare Support');
     $email->template('monthlyfeesuccess', 'generic')->emailFormat('html')->from(array($from => 'RentSquare Support'))->to($email_address)->subject('RentSquare Payment Receipt')->viewVars(array('email_data' => $email_data))->send();
     return true;
 }
开发者ID:veslo1,项目名称:RentSquare,代码行数:10,代码来源:MonthlyFeeShell.php

示例4: emailResetToken

 public function emailResetToken($email, $resetCode)
 {
     $host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
     $url = Router::url("/users/password_reset/{$resetCode}", true);
     $Email = new CakeEmail();
     $Email->from(["no-reply@{$host}" => $host]);
     $Email->to($email);
     $Email->sender("no-reply@{$host}", $host);
     $Email->subject("{$host} password reset.");
     return $Email->send("Hello, \n\nPlease use the link below to reset your password for {$host}\n\n{$url}\n\nWith regards, \n{$host}");
 }
开发者ID:sebbdk,项目名称:booking,代码行数:11,代码来源:User.php

示例5: main

 public function main()
 {
     $email = new CakeEmail();
     $email->config(array('transport' => 'AmazonSESTransport.AmazonSES', 'log' => true, 'Amazon.SES.Key' => Configure::read('Amazon.SES.Key'), 'Amazon.SES.Secret' => Configure::read('Amazon.SES.Secret')));
     $email->sender('no-reply@example.org');
     $email->from('no-reply@example.org', 'Example');
     $email->to('test@example.org');
     $email->bcc('bcc@example.org');
     $email->subject('SES Test from CakePHP');
     $res = $email->send('test message.');
     var_dump($res);
 }
开发者ID:news2u,项目名称:amazon-ses-transport,代码行数:12,代码来源:SampleCakeEmailShell.php

示例6: __SendContactUsEmail

 private function __SendContactUsEmail($data)
 {
     $from = Configure::read('RentSquare.supportemail');
     try {
         $email = new CakeEmail();
         $email->domain('rentsquaredev.com');
         $email->sender('noreply@rentsquaredev.com', 'RentSquare Support');
         $email->template('contactus', 'generic')->emailFormat('html')->from(array($from => 'RentSquare Support'))->to('sean.perlmutter@gmail.com')->subject('RentSquare Inquiry')->viewVars(array('data' => $data))->send();
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:13,代码来源:PagesController.php

示例7: send

 /**
  * Send
  * 
  * A bit of a misnomer, because this actually just adds it to a CakeResque
  * queue.  The actual sending of the email will be performed later by a worker.
  *
  * @params CakeEmail $email
  * @return array
  */
 public function send(CakeEmail $email)
 {
     // Take a copy of the existing configuration.
     $config = array('headers' => $email->getHeaders(), 'from' => $email->from(), 'sender' => $email->sender(), 'replyTo' => $email->replyTo(), 'readReceipt' => $email->readReceipt(), 'returnPath' => $email->returnPath(), 'to' => $email->to(), 'cc' => $email->cc(), 'bcc' => $email->bcc(), 'subject' => $email->subject(), 'viewRender' => $email->viewRender(), 'viewVars' => $email->viewVars(), 'emailFormat' => $email->emailFormat(), 'messageId' => $email->messageId(), 'attachments' => $email->attachments());
     //        unset($config['config']['transport']);
     $template = $email->template();
     $config['template'] = $template['template'];
     $config['layout'] = $template['layout'];
     // Clean it up to avoid errors.
     $config = array_filter($config, function ($v) {
         return (bool) $v;
     });
     debug($config);
     // Include a message, if they sent one via plain text.
     $message = $email->message(CakeEmail::MESSAGE_HTML) ? null : $email->message(CakeEmail::MESSAGE_TEXT);
     // Drop it in a queue.
     Resque::enqueue('email', 'ResqueEmail.EmailShell', array('send', $config, $message));
     return array('headers' => $email->getHeaders(), 'message' => $email->message());
 }
开发者ID:adderall,项目名称:cake-resque-email,代码行数:28,代码来源:QueuedTransport.php

示例8: sendForgetPassMail

 public function sendForgetPassMail($useremail, $userName, $userId, $fullName, $pass)
 {
     $email = new CakeEmail('smtp');
     $email->sender('admin@yumplate.com');
     $email->to($useremail);
     $email->emailFormat('html');
     $email->subject('Forget Password Mail');
     $body = " ";
     $body .= " Full Name : " . $fullName . '<br/>' . ' Email : ' . $userName . '<br/> Password : ' . $pass . '<br />';
     $body .= "Please Click on  following link to login <br />";
     $body .= '<a href="http://projects.udaantechnologies.com/yumplate/">Login link</a>';
     try {
         $result = $email->send($body);
     } catch (Exception $ex) {
         // we could not send the email, ignore it
         return false;
     }
     return true;
 }
开发者ID:pravendrakumar,项目名称:yumplate,代码行数:19,代码来源:User.php

示例9: forgottenPassword

 public function forgottenPassword($email)
 {
     if ($client = $this->Client->findByEmail($email)) {
         $client['Client']['token_password'] = sha1(rand(0, 154896258952));
         if ($this->Client->save($client)) {
             $message = 'Un email va vous être envoyer pour changer votre mot de passe';
             $Email = new CakeEmail();
             $Email->config('default');
             $Email->emailFormat('html');
             $Email->template('newpassword');
             $Email->viewVars(array('value' => $client['Client']['token_password']));
             $Email->from('lucas.estebanzucco@gmail.com');
             $Email->sender('lucas.estebanzucco@gmail.com', 'MyApp emailer');
             $Email->to($client['Client']['email']);
             $Email->subject('Change your password');
             $Email->send();
         }
     } else {
         $message = 'Erreur, impossible d\'effectuer l\'action ' . $email;
     }
     $this->set(array('message' => $message, '_serialize' => array('message')));
 }
开发者ID:gestrem,项目名称:dev_mwc,代码行数:22,代码来源:RestClientsController.php

示例10: sendChangePasswordMail

 /**
  * Used to send change password mail to user
  *
  * @access public
  * @param array $user user detail
  * @return void
  */
 public function sendChangePasswordMail($user)
 {
     $userId = $user['User']['id'];
     $email = new CakeEmail();
     $fromConfig = EMAIL_FROM_ADDRESS;
     $fromNameConfig = EMAIL_FROM_NAME;
     $email->from(array($fromConfig => $fromNameConfig));
     $email->sender(array($fromConfig => $fromNameConfig));
     $email->to($user['User']['email']);
     $email->subject(SITE_NAME . ': Change Password Confirmation');
     $body = "Hey " . $user['User']['first_name'] . ", You recently changed your password on " . date('Y M d h:i:s', time()) . ".\n\nAs a security precaution, this notification has been sent to your email addresse associated with your account.\n\nThanks,\n" . SITE_NAME;
     try {
         $result = $email->send($body);
     } catch (Exception $ex) {
         // we could not send the email, ignore it
         $result = "Could not send change password email to userid-" . $userId;
         $this->log($result, LOG_DEBUG);
     }
 }
开发者ID:riverans,项目名称:manage-expenses,代码行数:26,代码来源:User.php

示例11: __sendMaintenanceNotification

 private function __sendMaintenanceNotification($data, $user_details, $ticket_id)
 {
     $from = Configure::read('RentSquare.supportemail');
     $emailTo = "";
     foreach ($user_details as $property_manager) {
         $emailTo = $property_manager['Property']['Manager']['email'] . ', ';
     }
     $emailTo = rtrim($emailTo, ', ');
     try {
         $email = new CakeEmail();
         $email->domain('rentsquaredev.com');
         $email->sender('noreply@rentsquaredev.com', 'RentSquare Support');
         $email->template('newmaintenance', 'generic')->emailFormat('html')->from(array($from => 'RentSquare Support'))->to($emailTo)->subject('New Maintenance Ticket - RentSquare')->viewVars(array('data' => $data, 'user_details' => $user_details, 'ticket_id' => $ticket_id))->send();
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:veslo1,项目名称:RentSquare,代码行数:18,代码来源:MaintenanceTicketsController.php

示例12: forgotPassword

 /**
  * Used to send forgot password mail to user
  *
  * @access public
  * @param array $user user detail
  * @return void
  */
 public function forgotPassword($user)
 {
     $userId = $user['User']['id'];
     $email = new CakeEmail();
     $fromConfig = EMAIL_FROM_ADDRESS;
     $fromNameConfig = EMAIL_FROM_NAME;
     $email->from(array($fromConfig => $fromNameConfig));
     $email->sender(array($fromConfig => $fromNameConfig));
     $email->to($user['User']['email']);
     $email->subject(EMAIL_FROM_NAME . ': Request to Reset Your Password');
     $activate_key = $this->getActivationKey($user['User']['password']);
     $link = Router::url("/activatePassword?ident={$userId}&activate={$activate_key}", true);
     $body = "Welcome " . $user['User']['first_name'] . ", let's help you get signed in\n\nYou have requested to have your password reset on " . EMAIL_FROM_NAME . ". Please click the link below to reset your password now :\n\n" . $link . "\n\n\nIf above link does not work please copy and paste the URL link (above) into your browser address bar to get to the Page to reset password\n\nChoose a password you can remember and please keep it secure.\n\nThanks,\n" . EMAIL_FROM_NAME;
     try {
         $result = $email->send($body);
     } catch (Exception $ex) {
         // we could not send the email, ignore it
         $result = "Could not send forgot password email to userid-" . $userId;
     }
     $this->log($result, LOG_DEBUG);
 }
开发者ID:apa-narola,项目名称:cakephpaccount,代码行数:28,代码来源:User.php

示例13: forgotPassword

 /**
  * Used to send forgot password mail to user
  *
  * @access public
  * @param array $user user detail
  * @return void
  */
 public function forgotPassword($user)
 {
     $userId = $user['User']['id'];
     $email = new CakeEmail();
     $fromConfig = Configure::read('Site.email');
     $fromNameConfig = Configure::read('site.emailFromName');
     $email->from(array($fromConfig => $fromNameConfig));
     $email->sender(array($fromConfig => $fromNameConfig));
     $email->to($user['User']['email']);
     $email->subject(Configure::read('site.emailFromName') . ': Request to Reset Your Password');
     $activate_key = $this->getActivationKey($user['User']['passwd']);
     $link = Router::url("activate_password/{$userId}/{$activate_key}", true);
     $body = __("Welcome ") . $user['User']['first_name'] . __(", let's help you get signed in\nYou have requested to have your password reset on ") . Configure::read('site.emailFromName') . __(". Please click the link below to reset your password now :\n") . $link . __("\nIf above link does not work please copy and paste the URL link (above) into your browser address bar to get to the Page to reset password\n\nChoose a password you can remember and please keep it secure.\n\nThanks,") . "\n" . Configure::read('site.emailFromName');
     try {
         $result = $email->send($body);
         $this->updateAll(array('password_key' => "'" . $activate_key . "'"), array('id' => $userId));
     } catch (Exception $ex) {
         // we could not send the email, ignore it
         $result = __("Could not send forgot password email to userid-") . $userId;
     }
     $this->log($result, LOG_DEBUG);
 }
开发者ID:purgesoftwares,项目名称:tours,代码行数:29,代码来源:User.php

示例14: __sendRentReminderManual

 private function __sendRentReminderManual($emailTo, $message, $unit_number, $rent_due, $payment_id, $first_name, $billing_start, $billing_end, $rent_period)
 {
     $from = Configure::read('RentSquare.supportemail');
     try {
         $email = new CakeEmail();
         $email->domain('rentsquaredev.com');
         $email->sender('noreply@rentsquaredev.com', 'RentSquare Support');
         $email->template('manualreminder', 'generic')->emailFormat('html')->from(array($from => 'RentSquare Support'))->to(trim($emailTo))->subject('RentSquare Rent Reminder')->viewVars(array('message' => $message, 'unit_number' => $unit_number, 'rent_due' => $rent_due, 'payment_id' => $payment_id, 'first_name' => $first_name, 'billing_start' => $billing_start, 'billing_end' => $billing_end, 'rent_period' => $rent_period))->send();
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:13,代码来源:PaymentsController.php

示例15: CakeEmail

 function _sendEmail($template, $to, $subject, $viewVarsArray, $text = "")
 {
     $Email = new CakeEmail();
     $Email->config('gmail');
     $Email->sender('capstoneconsultants3@gmail.com', 'Volunteer Omaha');
     $Email->from(array('capstoneconsultants3@gmail.com' => 'Volunteer Omaha'));
     $Email->to($to);
     $Email->subject($subject);
     if (!empty($text)) {
         $Email->emailFormat('html');
         $Email->send($text);
     } else {
         $Email->emailFormat('html');
         $Email->template($template);
         $Email->viewVars($viewVarsArray);
         $Email->send();
     }
 }
开发者ID:KamiMoon,项目名称:volunteeromaha,代码行数:18,代码来源:AppController.php


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