Browse Source

update mail configuration file

Taylor Otwell 4 years ago
parent
commit
76d822768d
2 changed files with 98 additions and 77 deletions
  1. 2 1
      .env.example
  2. 96 76
      config/mail.php

+ 2 - 1
.env.example

@@ -23,7 +23,8 @@ REDIS_HOST=127.0.0.1
 REDIS_PASSWORD=null
 REDIS_PORT=6379
 
-MAIL_DRIVER=smtp
+MAIL_MAILER=smtp
+MAIL_TRANSPORT=smtp
 MAIL_HOST=smtp.mailtrap.io
 MAIL_PORT=2525
 MAIL_USERNAME=null

+ 96 - 76
config/mail.php

@@ -4,90 +4,110 @@ return [
 
     /*
     |--------------------------------------------------------------------------
-    | Mail Driver
+    | Default Mailer
     |--------------------------------------------------------------------------
     |
-    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
-    | sending of e-mail. You may specify which one you're using throughout
-    | your application here. By default, Laravel is setup for SMTP mail.
-    |
-    | Supported: "smtp", "sendmail", "mailgun", "ses",
-    |            "postmark", "log", "array"
+    | This option controls the default mailer that is used to send any email
+    | messages sent by your application. Alternative mailers may be setup
+    | and used as needed; however, this mailer will be used by default.
     |
     */
 
-    'driver' => env('MAIL_DRIVER', 'smtp'),
-
-    /*
-    |--------------------------------------------------------------------------
-    | SMTP Host Address
-    |--------------------------------------------------------------------------
-    |
-    | Here you may provide the host address of the SMTP server used by your
-    | applications. A default option is provided that is compatible with
-    | the Mailgun mail service which will provide reliable deliveries.
-    |
-    */
-
-    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
-
-    /*
-    |--------------------------------------------------------------------------
-    | SMTP Host Port
-    |--------------------------------------------------------------------------
-    |
-    | This is the SMTP port used by your application to deliver e-mails to
-    | users of the application. Like the host we have set this value to
-    | stay compatible with the Mailgun e-mail application by default.
-    |
-    */
-
-    'port' => env('MAIL_PORT', 587),
-
-    /*
-    |--------------------------------------------------------------------------
-    | Global "From" Address
-    |--------------------------------------------------------------------------
-    |
-    | You may wish for all e-mails sent by your application to be sent from
-    | the same address. Here, you may specify a name and address that is
-    | used globally for all e-mails that are sent by your application.
-    |
-    */
+    'default' => env('MAIL_MAILER', 'smtp'),
+
+    'mailers' => [
+
+        'smtp' => [
+
+            /*
+            |--------------------------------------------------------------------------
+            | Mail Transport Driver
+            |--------------------------------------------------------------------------
+            |
+            | Laravel supports a variety of mail "transport" drivers to be used while
+            | sending an e-mail. You will specify which one you are using for this
+            | mailer here. The mailer is configured to send via SMTP by default.
+            |
+            | Supported: "smtp", "sendmail", "mailgun", "ses",
+            |            "postmark", "log", "array"
+            |
+            */
+
+            'transport' => env('MAIL_TRANSPORT', 'smtp'),
+
+            /*
+            |--------------------------------------------------------------------------
+            | SMTP Host Address
+            |--------------------------------------------------------------------------
+            |
+            | Here you may provide the host address of the SMTP server used by your
+            | applications. A default option is provided that is compatible with
+            | the Mailgun mail service which will provide reliable deliveries.
+            |
+            */
+
+            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
+
+            /*
+            |--------------------------------------------------------------------------
+            | SMTP Host Port
+            |--------------------------------------------------------------------------
+            |
+            | This is the SMTP port used by this mailer when delivering e-mails to
+            | users of the application. Like the host we have set this value to
+            | stay compatible with the Mailgun e-mail application by default.
+            |
+            */
+
+            'port' => env('MAIL_PORT', 587),
+
+            /*
+            |--------------------------------------------------------------------------
+            | Global "From" Address
+            |--------------------------------------------------------------------------
+            |
+            | You may wish for all e-mails sent by your application to be sent from
+            | the same address. Here, you may specify a name and address that is
+            | used globally for all e-mails that are sent through this mailer.
+            |
+            */
+
+            'from' => [
+                'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
+                'name' => env('MAIL_FROM_NAME', 'Example'),
+            ],
+
+            /*
+            |--------------------------------------------------------------------------
+            | E-Mail Encryption Protocol
+            |--------------------------------------------------------------------------
+            |
+            | Here you may specify the encryption protocol that should be used when
+            | the mailer sends any e-mail messages. A sensible default using the
+            | transport layer security protocol should provide great security.
+            |
+            */
+
+            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+
+            /*
+            |--------------------------------------------------------------------------
+            | SMTP Server Username
+            |--------------------------------------------------------------------------
+            |
+            | If your SMTP server requires a username for authentication, you should
+            | set it here. This will get used to authenticate with your server on
+            | connection. You may also set the "password" value below this one.
+            |
+            */
+
+            'username' => env('MAIL_USERNAME'),
+
+            'password' => env('MAIL_PASSWORD'),
 
-    'from' => [
-        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
-        'name' => env('MAIL_FROM_NAME', 'Example'),
+        ],
     ],
 
-    /*
-    |--------------------------------------------------------------------------
-    | E-Mail Encryption Protocol
-    |--------------------------------------------------------------------------
-    |
-    | Here you may specify the encryption protocol that should be used when
-    | the application send e-mail messages. A sensible default using the
-    | transport layer security protocol should provide great security.
-    |
-    */
-
-    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
-
-    /*
-    |--------------------------------------------------------------------------
-    | SMTP Server Username
-    |--------------------------------------------------------------------------
-    |
-    | If your SMTP server requires a username for authentication, you should
-    | set it here. This will get used to authenticate with your server on
-    | connection. You may also set the "password" value below this one.
-    |
-    */
-
-    'username' => env('MAIL_USERNAME'),
-
-    'password' => env('MAIL_PASSWORD'),
-
     /*
     |--------------------------------------------------------------------------
     | Sendmail System Path