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


PHP Message::getEncodedHeader方法代码示例

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


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

示例1: send

 /**
  * Sends email.
  * @param  Message
  * @return void
  */
 public function send(Message $mail)
 {
     $tmp = clone $mail;
     $tmp->setHeader('Subject', NULL);
     $tmp->setHeader('To', NULL);
     $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2);
     Nette\Diagnostics\Debugger::tryError();
     $res = mail(str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), str_replace(Message::EOL, PHP_EOL, $parts[1]), str_replace(Message::EOL, PHP_EOL, $parts[0]), (string) $this->commandArgs);
     if (Nette\Diagnostics\Debugger::catchError($e)) {
         throw new Nette\InvalidStateException('mail(): ' . $e->getMessage(), 0, $e);
     } elseif (!$res) {
         throw new Nette\InvalidStateException('Unable to send email.');
     }
 }
开发者ID:kovkus,项目名称:r-cms,代码行数:19,代码来源:SendmailMailer.php

示例2: send

 /**
  * Sends email.
  * @return void
  */
 public function send(Message $mail)
 {
     $tmp = clone $mail;
     $tmp->setHeader('Subject', NULL);
     $tmp->setHeader('To', NULL);
     $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2);
     $args = array(str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), str_replace(Message::EOL, PHP_EOL, $parts[1]), str_replace(Message::EOL, PHP_EOL, $parts[0]));
     if ($this->commandArgs) {
         $args[] = (string) $this->commandArgs;
     }
     if (call_user_func_array('mail', $args) === FALSE) {
         $error = error_get_last();
         throw new Nette\InvalidStateException("Unable to send email: {$error['message']}.");
     }
 }
开发者ID:vrtak-cz,项目名称:nette-doctrine-sandbox,代码行数:19,代码来源:SendmailMailer.php

示例3: send

 /**
  * Sends email.
  * @return void
  */
 public function send(Message $mail)
 {
     $tmp = clone $mail;
     $tmp->setHeader('Subject', NULL);
     $tmp->setHeader('To', NULL);
     $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2);
     $args = array(str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), str_replace(Message::EOL, PHP_EOL, $parts[1]), str_replace(Message::EOL, PHP_EOL, $parts[0]));
     if ($this->commandArgs) {
         $args[] = (string) $this->commandArgs;
     }
     $res = Nette\Utils\Callback::invokeSafe('mail', $args, function ($message) use(&$info) {
         $info = ": {$message}";
     });
     if ($res === FALSE) {
         throw new Nette\InvalidStateException("Unable to send email{$info}.");
     }
 }
开发者ID:vol0054,项目名称:vizitky,代码行数:21,代码来源:SendmailMailer.php

示例4: send

 /**
  * Sends email.
  * @return void
  */
 public function send(Message $mail)
 {
     $tmp = clone $mail;
     $tmp->setHeader('Subject', NULL);
     $tmp->setHeader('To', NULL);
     $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2);
     $args = array(str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), str_replace(Message::EOL, PHP_EOL, $parts[1]), str_replace(Message::EOL, PHP_EOL, $parts[0]));
     if ($this->commandArgs) {
         $args[] = (string) $this->commandArgs;
     }
     set_error_handler(function ($severity, $message) use(&$info) {
         $info = ": {$message}";
     });
     $res = call_user_func_array('mail', $args);
     restore_error_handler();
     if ($res === FALSE) {
         throw new Nette\InvalidStateException("Unable to send email{$info}.");
     }
 }
开发者ID:prcharom,项目名称:w-pps-reality,代码行数:23,代码来源:SendmailMailer.php


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