本文整理汇总了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);
}
示例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/');
}
}
示例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();
}