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


PHP Mailer::alwaysFrom方法代碼示例

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


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

示例1: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->registerSwiftMailer();
     $this->app['mailer'] = $this->app->share(function ($app) {
         // Once we have create the mailer instance, we will set a container instance
         // on the mailer. This allows us to resolve mailer classes via containers
         // for maximum testability on said classes instead of passing Closures.
         $mailer = new Mailer($app['view'], $app['swift.mailer']);
         $mailer->setLogger($app['log'])->setQueue($app['queue']);
         $mailer->setContainer($app);
         // If a "from" address is set, we will set it on the mailer so that all mail
         // messages sent by the applications will utilize the same "from" address
         // on each one, which makes the developer's life a lot more convenient.
         $from = $app['config']['mail.from'];
         if (is_array($from) and isset($from['address'])) {
             $mailer->alwaysFrom($from['address'], $from['name']);
         }
         // Here we will determine if the mailer should be in "pretend" mode for this
         // environment, which will simply write out e-mail to the logs instead of
         // sending it over the web, which is useful for local dev enviornments.
         $pretend = $app['config']->get('mail.pretend', false);
         $mailer->pretend($pretend);
         return $mailer;
     });
 }
開發者ID:Thomvh,項目名稱:turbine,代碼行數:30,代碼來源:MailServiceProvider.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->registerSwiftMailer();
     $this->app['mailer'] = $this->app->share(function ($app) {
         // Once we have create the mailer instance, we will set a container instance
         // on the mailer. This allows us to resolve mailer classes via containers
         // for maximum testability on said classes instead of passing Closures.
         $mailer = new Mailer($app['view'], $app['swift.mailer']);
         $mailer->setLogger($app['log'])->setQueue($app['queue']);
         $mailer->setContainer($app);
         $from = $app['config']['mail.from'];
         // If a "from" address is set, we will set it on the mailer so that all mail
         // messages sent by the applications will utilize the same "from" address
         // on each one, which makes the developer's life a lot more convenient.
         if (is_array($from) and isset($from['address'])) {
             $mailer->alwaysFrom($from['address'], $from['name']);
         }
         return $mailer;
     });
 }
開發者ID:brucewu16899,項目名稱:laravel-admin-panel,代碼行數:25,代碼來源:MailServiceProvider.php

示例3: alwaysFrom

 /**
  * Set the global from address and name.
  *
  * @param string $address
  * @param string|null $name
  * @return void 
  * @static 
  */
 public static function alwaysFrom($address, $name = null)
 {
     \Illuminate\Mail\Mailer::alwaysFrom($address, $name);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:12,代碼來源:_ide_helper.php


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