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


PHP Swift_RecipientList::getCc方法代碼示例

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


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

示例1: send

 /**
  * Send an email to a number of recipients
  * Returns the number of successful recipients, or FALSE on failure
  * @param mixed The recipients to send to.  One of string, array, 2-dimensional array or Swift_Address
  * @param mixed The address to send from. string or Swift_Address
  * @param string The message subject
  * @param string The message body, optional
  * @return int
  */
 function send($recipients, $from, $subject, $body = null)
 {
     $this->addTo($recipients);
     $sender = false;
     if (is_string($from)) {
         $sender = $this->stringToAddress($from);
     } elseif (is_a($from, "Swift_Address")) {
         $sender =& $from;
     }
     if (!$sender) {
         return false;
     }
     $this->message->setSubject($subject);
     if ($body) {
         $this->message->setBody($body);
     }
     $sent = 0;
     Swift_Errors::expect($e, "Swift_ConnectionException");
     if (!$this->exactCopy && !$this->recipients->getCc() && !$this->recipients->getBcc()) {
         $sent = $this->swift->batchSend($this->message, $this->recipients, $sender);
     } else {
         $sent = $this->swift->send($this->message, $this->recipients, $sender);
     }
     if (!$e) {
         Swift_Errors::clear("Swift_ConnectionException");
         if ($this->autoFlush) {
             $this->flush();
         }
         return $sent;
     }
     $this->setError("Sending failed:<br />" . $e->getMessage());
     return false;
 }
開發者ID:jeffthestampede,項目名稱:excelsior,代碼行數:42,代碼來源:EasySwift.php

示例2: send

 /**
  * Send an email to a number of recipients
  * Returns the number of successful recipients, or FALSE on failure
  * @param mixed The recipients to send to.  One of string, array, 2-dimensional array or Swift_Address
  * @param mixed The address to send from. string or Swift_Address
  * @param string The message subject
  * @param string The message body, optional
  * @return int
  */
 public function send($recipients, $from, $subject, $body = null)
 {
     $this->addTo($recipients);
     $sender = false;
     if (is_string($from)) {
         $sender = $this->stringToAddress($from);
     } elseif ($from instanceof Swift_Address) {
         $sender = $from;
     }
     if (!$sender) {
         return false;
     }
     $this->message->setSubject($subject);
     if ($body) {
         $this->message->setBody($body);
     }
     try {
         if (!$this->exactCopy && !$this->recipients->getCc() && !$this->recipients->getBcc()) {
             $sent = $this->swift->batchSend($this->message, $this->recipients, $sender);
         } else {
             $sent = $this->swift->send($this->message, $this->recipients, $sender);
         }
         if ($this->autoFlush) {
             $this->flush();
         }
         return $sent;
     } catch (Swift_ConnectionException $e) {
         $this->setError("Sending failed:<br />" . $e->getMessage());
         return false;
     }
 }
開發者ID:darkcolonist,項目名稱:kohana234-doctrine115,代碼行數:40,代碼來源:EasySwift.php

示例3: testDuplicateEntriesInSameFieldAreOverWritten

 /**
  * Test that only no duplicates can exist.
  */
 public function testDuplicateEntriesInSameFieldAreOverWritten()
 {
     $list = new Swift_RecipientList();
     $list->addCc(new Swift_Address("foo@bar.com"));
     $list->addCc("joe@bloggs.com", "Joe");
     $list->addCc("jim@somewhere.co.uk");
     $list->addCc("foo@bar.com", "Foo");
     $this->assertEqual(3, count($list->getCc()));
 }
開發者ID:Esleelkartea,項目名稱:legedia-ESLE,代碼行數:12,代碼來源:TestOfRecipientList.php


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