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


PHP Zend_Mail::addCC方法代码示例

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


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

示例1: addRequest

 /** Add a new help request message and send email to Scheme in box.
  */
 public function addRequest($data)
 {
     if (!empty($data['csrf'])) {
         unset($data['csrf']);
     }
     if (empty($data['comment_date'])) {
         $data['comment_date'] = $this->timeCreation();
     }
     if (empty($data['updatedBy'])) {
         $data['updatedBy'] = $this->userNumber();
     }
     if ($this->_akismet->isSpam($data)) {
         $data['comment_approved'] = self::SPAM;
     } else {
         $data['comment_approved'] = self::NOTSPAM;
     }
     $mail = new Zend_Mail();
     $mail->setBodyText('You submitted this comment/ query: ' . strip_tags($data['comment_content']));
     $mail->setFrom($data['comment_author_email'], $data['comment_author']);
     $mail->addTo('info@finds.org.uk', 'The Portable Antiquities Scheme');
     $mail->addCC($data['comment_author_email'], $data['comment_author']);
     $mail->setSubject('Contact us submission');
     $mail->send();
     return parent::insert($data);
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:27,代码来源:Messages.php

示例2: emailAction

 /** Email a search result
  */
 public function emailAction()
 {
     $user = $this->getAccount();
     $this->view->headTitle('Email this search to another person');
     $searches = new Searches();
     $lastsearch = $searches->fetchRow($searches->select()->where('userid = ?', $this->getIdentityForForms())->order('id DESC'));
     if (count($lastsearch)) {
         $querystring = unserialize($lastsearch->searchString);
         $params = array();
         $query = '';
         foreach ($querystring as $key => $value) {
             $query .= $key . '/' . $value . '/';
             $params[$key] = $value;
         }
         $this->view->params = $params;
         $form = new EmailSearchForm();
         $this->view->form = $form;
         if ($this->_request->isPost()) {
             $data = $this->_getAllParams();
             if ($form->isValid($data)) {
                 $sender = $user->fullname;
                 $senderemail = $user->email;
                 $recipient = $form->getValue('fullname');
                 $recipientemail = $form->getValue('email');
                 $message = $form->getValue('messageToUser');
                 $strippedmessage = strip_tags($message);
                 $url = 'http://' . $_SERVER['SERVER_NAME'] . '/database/search/results/' . $query;
                 $mail = new Zend_Mail();
                 $mail->addHeader('X-MailGenerator', 'The Portable Antiquities Scheme\'s awesome database');
                 $mail->setBodyHtml('<p>Dear ' . $recipient . '</p>' . $message . '<p>Located at this url:  ' . $url . '</p><p>From ' . $sender . '</p>');
                 $mail->setFrom('info@finds.org.uk', 'The Portable Antiquities Scheme');
                 $mail->setBodyText('Dear ' . $recipient . ',' . $message . ' ' . $url . 'From,' . $sender);
                 $mail->addTo($recipientemail, $recipient);
                 $mail->addCC($senderemail, $sender);
                 $mail->setSubject('I thought you might be interested in this search on the PAS Database.');
                 $mail->send();
                 $this->_flashMessenger->addMessage('Your email has been sent to ' . $recipient . '. Thank you for sending them some of our records.');
                 $this->_redirect('/database/search/results/' . $query);
             } else {
                 $form->populate($data);
             }
         }
     } else {
         $this->_flashMessenger->addMessage('You haven\'t ever searched, so you have nothing to email!');
         $this->_redirect('/database/search/');
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:49,代码来源:SearchController.php

示例3: notify

 /** Provide a notification for an object
  */
 protected function notify($objecttype, $broadperiod, $data)
 {
     $findData = (object) $data;
     $finds = new Users();
     $owner = $finds->getOwner($findData->comment_findID);
     $advisers = $this->getAdviser($objecttype, $broadperiod);
     $mail = new Zend_Mail('UTF-8');
     $mail->setFrom('info@finds.org.uk', 'The Portable Antiquities Scheme error reporter');
     $mail->setSubject('Error report submitted on record id number : ' . $owner['0']['old_findID']);
     foreach ($advisers as $k => $v) {
         $mail->addCC($v, $k);
     }
     $message = '';
     $message .= $findData->comment_author;
     $message .= ' submitted an error report type: ' . $findData->comment_type;
     $message .= "\n";
     $message .= 'Copied to Finds Adviser(s) in case action is required.';
     $message .= "\n";
     $message .= strip_tags(nl2br($findData->comment_content));
     $message .= "\n";
     $message .= 'Error report on http://www.finds.org.uk/database/artefacts/record/id/' . $findData->comment_findID;
     $message .= "\n";
     $message .= 'Object type: ' . $owner['0']['objecttype'];
     $message .= "\n";
     $message .= 'Broadperiod: ' . $owner['0']['broadperiod'];
     $message .= "\n";
     $message .= 'Thank you for taking the time to submit an error to us. We appreciate that you have taken the time to improve our database';
     $mail->addCC($findData->comment_author_email, $findData->comment_author);
     $mail->addTo($owner['0']['email'], $owner['0']['fullname']);
     $mail->setBodyText($message);
     $mail->send();
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:34,代码来源:ArtefactsController.php


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