当前位置: 首页>>代码示例>>PHP>>正文


PHP Swift_Mime_Message::getSender方法代码示例

本文整理汇总了PHP中Swift_Mime_Message::getSender方法的典型用法代码示例。如果您正苦于以下问题:PHP Swift_Mime_Message::getSender方法的具体用法?PHP Swift_Mime_Message::getSender怎么用?PHP Swift_Mime_Message::getSender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Swift_Mime_Message的用法示例。


在下文中一共展示了Swift_Mime_Message::getSender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send

 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     $failedRecipients = (array) $failedRecipients;
     $msg = '* ' . $message->getSubject() . ' *' . PHP_EOL . PHP_EOL;
     if ($message instanceof CM_Mail_Message) {
         $msg .= $message->getText() . PHP_EOL;
     } else {
         $msg .= $message->getBody() . PHP_EOL;
     }
     $logger = $this->getLogger();
     $context = new CM_Log_Context();
     $context->setExtra(['type' => CM_Paging_Log_Mail::getTypeStatic(), 'sender' => $message->getSender(), 'replyTo' => $message->getReplyTo(), 'to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()]);
     $logger->addMessage($msg, $this->_logLevel, $context);
     return count($message->getTo()) + count($message->getCc()) + count($message->getBcc());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:15,代码来源:Log.php

示例2: getReversePath

 /** Determine the best-use reverse path for this message */
 private function getReversePath(Swift_Mime_Message $message)
 {
     $return = $message->getReturnPath();
     $sender = $message->getSender();
     $from = $message->getFrom();
     $path = null;
     if (!empty($return)) {
         $path = $return;
     } elseif (!empty($sender)) {
         $keys = array_keys($sender);
         $path = array_shift($keys);
     } elseif (!empty($from)) {
         $keys = array_keys($from);
         $path = array_shift($keys);
     }
     return $path;
 }
开发者ID:swiftmailer,项目名称:swiftmailer,代码行数:18,代码来源:MailTransport.php

示例3: getReversePath

 /** Determine the best-use reverse path for this message */
 protected function getReversePath(Swift_Mime_Message $message)
 {
     $return = $message->getReturnPath();
     $sender = $message->getSender();
     $from = $message->getFrom();
     $path = null;
     if (!empty($return)) {
         $path = $return;
     } elseif (!empty($sender)) {
         // Don't use array_keys
         reset($sender);
         // Reset Pointer to first pos
         $path = key($sender);
         // Get key
     } elseif (!empty($from)) {
         reset($from);
         // Reset Pointer to first pos
         $path = key($from);
         // Get key
     }
     return $path;
 }
开发者ID:jaeger-app,项目名称:swiftmailer,代码行数:23,代码来源:AbstractSmtpTransport.php


注:本文中的Swift_Mime_Message::getSender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。