當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Message::attachSigner方法代碼示例

本文整理匯總了PHP中Illuminate\Mail\Message::attachSigner方法的典型用法代碼示例。如果您正苦於以下問題:PHP Message::attachSigner方法的具體用法?PHP Message::attachSigner怎麽用?PHP Message::attachSigner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Mail\Message的用法示例。


在下文中一共展示了Message::attachSigner方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createMessage

 /**
  * Create a new message instance.
  *
  * @return \Illuminate\Mail\Message
  */
 protected function createMessage()
 {
     // Get the DKIM selector.
     $selector = Config::get('mail.dkim.selector');
     // If we have a DKIM selector, then add the signing.
     if (!empty($selector)) {
         // Use the signed message with support for signing.
         // So long as there is a selector we will do this, even if a private
         // key is not set. This is handy if the application wants to add its
         // own signatures later.
         $message = new Message(new Swift_SignedMessage());
         // Get the key and domain name.
         // Ideally these would be specific to the selector, with the selector being
         // chosen according to the domain of the sending address. At this stage we do
         // not know what the final sending addressis going to be.
         $private_key = Config::get('mail.dkim.private_key');
         $domain_name = Config::get('mail.dkim.domain_name');
         if (!empty($private_key) && !empty($domain_name)) {
             // Do the DKIM signing.
             $dkim_signer = new Swift_Signers_DKIMSigner($private_key, $domain_name, $selector);
             // Issue #1: ignore certain headers that cause end-to-end failure.
             $dkim_signer->ignoreHeader('Return-Path');
             $dkim_signer->ignoreHeader('Bcc');
             $dkim_signer->ignoreHeader('DKIM-Signature');
             $dkim_signer->ignoreHeader('Received');
             $dkim_signer->ignoreHeader('Comments');
             $dkim_signer->ignoreHeader('Keywords');
             $dkim_signer->ignoreHeader('Resent-Bcc');
             $message->attachSigner($dkim_signer);
         }
     } else {
         // Non-signed message.
         $message = new Message(new Swift_Message());
     }
     // If a global from address has been specified we will set it on every message
     // instances so the developer does not have to repeat themselves every time
     // they create a new message. We will just go ahead and push the address.
     if (isset($this->from['address'])) {
         $message->from($this->from['address'], $this->from['name']);
     }
     return $message;
 }
開發者ID:academe,項目名稱:laraveldkim,代碼行數:47,代碼來源:Mailer.php


注:本文中的Illuminate\Mail\Message::attachSigner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。