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


PHP ezcMailTools::generateMessageId方法代码示例

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


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

示例1: generateHeaders

 /**
  * Returns the generated headers for the mail.
  *
  * This method is called automatically when the mail message is built.
  * You can re-implement this method in subclasses if you wish to set
  * different mail headers than ezcMail.
  *
  * @return string
  */
 public function generateHeaders()
 {
     // set our headers first.
     if ($this->from !== null) {
         $this->setHeader("From", ezcMailTools::composeEmailAddress($this->from));
     }
     if ($this->to !== null) {
         $this->setHeader("To", ezcMailTools::composeEmailAddresses($this->to));
     }
     if (count($this->cc)) {
         $this->setHeader("Cc", ezcMailTools::composeEmailAddresses($this->cc));
     }
     if (count($this->bcc)) {
         $this->setHeader("Bcc", ezcMailTools::composeEmailAddresses($this->bcc));
     }
     $this->setHeader('Subject', $this->subject, $this->subjectCharset);
     $this->setHeader('MIME-Version', '1.0');
     $this->setHeader('User-Agent', 'eZ Components');
     $this->setHeader('Date', date('r'));
     $idhost = $this->from != null && $this->from->email != '' ? $this->from->email : 'localhost';
     if (is_null($this->messageId)) {
         $this->setHeader('Message-Id', '<' . ezcMailTools::generateMessageId($idhost) . '>');
     } else {
         $this->setHeader('Message-Id', $this->messageID);
     }
     // if we have a body part, include the headers of the body
     if (is_subclass_of($this->body, "ezcMailPart")) {
         return parent::generateHeaders() . $this->body->generateHeaders();
     }
     return parent::generateHeaders();
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:40,代码来源:mail.php


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