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


PHP Swift_Mime_Message::getFrom方法代码示例

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


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

示例1: send

 public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 {
     if (!$message->getFrom()) {
         if ($from = self::getDefaultFrom()) {
             $message->setFrom($from);
         }
     }
     if ($this->wa_set_transport) {
         $this->_transport = self::getTransportByEmail(key($message->getFrom()));
     }
     return parent::send($message, $failedRecipients);
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:12,代码来源:waMail.class.php

示例2: _logSendError

 /**
  * @param Swift_Mime_Message $message
  * @param array|null         $failedRecipients
  * @param Exception|null     $exception
  */
 protected function _logSendError(Swift_Mime_Message $message, array $failedRecipients = null, Exception $exception = null)
 {
     $context = new CM_Log_Context();
     $context->setExtra(['message' => ['subject' => $message->getSubject(), 'from' => $message->getFrom(), 'to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()], 'failedRecipients' => $failedRecipients]);
     if ($exception) {
         $context->setException($exception);
     }
     $this->getServiceManager()->getLogger()->error('Failed to send email', $context);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:14,代码来源:Mailer.php

示例3: send

 public function send(\Swift_Mime_Message $message, &$failedRecipients = null)
 {
     if (!empty(\GO::config()->disable_mail)) {
         throw new \Exception("E-mail sending is disabled!");
     }
     if (\GO::config()->debug) {
         $getTo = $message->getTo();
         if (!empty($getTo)) {
             $getTo = implode(",", array_keys($getTo));
         } else {
             $getTo = '';
         }
         \GO::debug("Sending e-mail to " . $getTo);
     }
     if (\GO::modules()->isInstalled("log")) {
         $str = "";
         $from = $message->getFrom();
         if (!empty($from)) {
             $str .= implode(",", array_keys($from));
         } else {
             $str .= "unknown";
         }
         $str .= " -> ";
         $to = $message->getTo();
         if (!empty($to)) {
             $str .= implode(",", array_keys($to));
         }
         $to = $message->getCc();
         if (!empty($to)) {
             $str .= implode(",", array_keys($to));
         }
         $to = $message->getBcc();
         if (!empty($to)) {
             $str .= implode(",", array_keys($to));
         }
         \GO\Log\Model\Log::create("email", $str);
     }
     //		debug_print_backtrace();
     //		exit("NO MAIL");
     //workaround https://github.com/swiftmailer/swiftmailer/issues/335
     $messageId = $message->getId();
     $count = parent::send($message, $failedRecipients);
     $message->setId($messageId);
     // Check if a tmp dir is created to store attachments.
     // If so, then remove the tmp dir if the mail is send successfully.
     $tmpDir = $message->getTmpDir();
     if (!empty($tmpDir)) {
         $folder = new \GO\Base\Fs\Folder($tmpDir);
         // Check if folder is deleted successfully
         if ($folder->delete()) {
             \GO::debug('Clear attachments tmp directory: ' . $tmpDir);
         } else {
             \GO::debug('Failed to clear attachments tmp directory: ' . $tmpDir);
         }
     }
     return $count;
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:57,代码来源:Mailer.php

示例4: 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

示例5: 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

示例6: info

 /**
  * Generate a human readable HTML comment with message info.
  *
  * @return string
  */
 private function info()
 {
     return sprintf("<!--\nFrom:%s, \nTo:%s, \nReply-to:%s, \nCC:%s, \nBCC:%s, \nSubject:%s\n-->\n", json_encode($this->message->getFrom()), json_encode($this->message->getTo()), json_encode($this->message->getReplyTo()), json_encode($this->message->getCc()), json_encode($this->message->getBcc()), $this->message->getSubject());
 }
开发者ID:laravelflare,项目名称:mail-debug,代码行数:9,代码来源:MailDebugManager.php


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