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


PHP Swift_Mime_Message::setCc方法代碼示例

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


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

示例1: _restoreMessage

 private function _restoreMessage(Swift_Mime_Message $message)
 {
     // restore original headers
     $headers = $message->getHeaders();
     if ($headers->has('X-Swift-To')) {
         $message->setTo($headers->get('X-Swift-To')->getNameAddresses());
         $headers->removeAll('X-Swift-To');
     }
     if ($headers->has('X-Swift-Cc')) {
         $message->setCc($headers->get('X-Swift-Cc')->getNameAddresses());
         $headers->removeAll('X-Swift-Cc');
     }
     if ($headers->has('X-Swift-Bcc')) {
         $message->setBcc($headers->get('X-Swift-Bcc')->getNameAddresses());
         $headers->removeAll('X-Swift-Bcc');
     }
 }
開發者ID:JamesLinus,項目名稱:platform,代碼行數:17,代碼來源:RedirectingPlugin.php

示例2: batchSend

 /**
  * Send the given Message to all recipients individually.
  * 
  * This differs from {@link send()} in the way headers are presented to the
  * recipient.  The only recipient in the "To:" field will be the individual
  * recipient it was sent to.
  * 
  * If an iterator is provided, recipients will be read from the iterator
  * one-by-one, otherwise recipient data will be retreived from the Message
  * object.
  * 
  * Sender information is always read from the Message object.
  * 
  * The return value is the number of recipients who were accepted for
  * delivery.
  * 
  * @param Swift_Mime_Message $message
  * @param array &$failedRecipients, optional
  * @param Swift_Mailer_RecipientIterator $it, optional
  * @return int
  * @see send()
  */
 public function batchSend(Swift_Mime_Message $message, &$failedRecipients = null, Swift_Mailer_RecipientIterator $it = null)
 {
     $failedRecipients = (array) $failedRecipients;
     $sent = 0;
     $to = $message->getTo();
     $cc = $message->getCc();
     $bcc = $message->getBcc();
     if (!empty($cc)) {
         $message->setCc(array());
     }
     if (!empty($bcc)) {
         $message->setBcc(array());
     }
     //Use an iterator if set
     if (isset($it)) {
         while ($it->hasNext()) {
             $message->setTo($it->nextRecipient());
             $sent += $this->send($message, $failedRecipients);
         }
     } else {
         foreach ($to as $address => $name) {
             $message->setTo(array($address => $name));
             $sent += $this->send($message, $failedRecipients);
         }
     }
     $message->setTo($to);
     if (!empty($cc)) {
         $message->setCc($cc);
     }
     if (!empty($bcc)) {
         $message->setBcc($bcc);
     }
     return $sent;
 }
開發者ID:fobihz,項目名稱:cndiesel,代碼行數:56,代碼來源:Mailer.php


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