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


PHP Swift_Mime_Message::toString方法代碼示例

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


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

示例1: send

 /**
  * "Send" the given Message. This transport will add it to a stored collection of sent messages
  * for testing purposes and log the message to the system logger.
  *
  * @param \Swift_Mime_Message $message The message to send
  * @param array &$failedRecipients Failed recipients
  * @return integer
  */
 public function send(\Swift_Mime_Message $message, &$failedRecipients = null)
 {
     self::$deliveredMessages[] = $message;
     $this->systemLogger->log('Sent email to ' . $this->buildStringFromEmailAndNameArray($message->getTo()), LOG_DEBUG, array('message' => $message->toString()));
     return count((array) $message->getTo()) + count((array) $message->getCc()) + count((array) $message->getBcc());
 }
開發者ID:neos,項目名稱:swiftmailer,代碼行數:14,代碼來源:LoggingTransport.php

示例2: send

 /**
  * Sends the given message.
  *
  * @param Swift_Mime_Message $message
  * @param string[]           $failedRecipients An array of failures by-reference
  *
  * @return int     The number of sent emails
  */
 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     $hFile = @fopen($this->sLogFile, 'a');
     if ($hFile) {
         $sTxt = "================== " . date('Y-m-d H:i:s') . " ==================\n";
         $sTxt .= $message->toString() . "\n";
         @fwrite($hFile, $sTxt);
         @fclose($hFile);
     }
     return parent::send($message, $failedRecipients);
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:19,代碼來源:email.class.inc.php

示例3: saveToFile

 /**
  * Save the complete message to the filesystem for testing and debugging
  *
  * @param Swift_Mime_Message $message the email message to log
  * @throws CException if the file system is not writeable
  */
 protected function saveToFile(Swift_Mime_Message $message)
 {
     if (!$this->logDirectory) {
         $this->logDirectory = Yii::app()->getRuntimePath() . DIRECTORY_SEPARATOR . "email";
     }
     if (($logPath = realpath($this->logDirectory)) === false || !is_dir($logPath) || !is_writable($logPath)) {
         mkdir($this->logDirectory, 0777, true);
     }
     $fileName = 'SwiftMailer_' . $_SERVER['REQUEST_TIME'] . '_' . mt_rand() . '.tmp';
     $file = $this->logDirectory . DIRECTORY_SEPARATOR . $fileName;
     if (!is_writable(dirname($file))) {
         throw new CException('Email log directory "' . dirname($file) . '" does not exist or is not writable');
     }
     if (!file_put_contents($file, quoted_printable_decode($message->toString()))) {
         throw new CException('Unable to log mail');
     }
 }
開發者ID:narwold,項目名稱:Small-Potatoes,代碼行數:23,代碼來源:SYiiMail.php


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