本文整理匯總了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();
}