当前位置: 首页>>代码示例>>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;未经允许,请勿转载。