From 61ec16fe392967766b68d865ed10d56275a78718 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 8 Jan 2020 17:10:37 -0600 Subject: [PATCH] work on mail configuration file --- .env.example | 1 - config/mail.php | 136 +++++++++++++----------------------------------- 2 files changed, 36 insertions(+), 101 deletions(-) diff --git a/.env.example b/.env.example index 8a179047..6382ea1b 100644 --- a/.env.example +++ b/.env.example @@ -24,7 +24,6 @@ REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_MAILER=smtp -MAIL_TRANSPORT=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null diff --git a/config/mail.php b/config/mail.php index 53afed51..6f3e2c83 100644 --- a/config/mail.php +++ b/config/mail.php @@ -15,111 +15,60 @@ 'default' => env('MAIL_MAILER', 'smtp'), + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | 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" + | + */ + '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. - | - */ - + 'transport' => 'smtp', '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'), + ], + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => '/usr/sbin/sendmail -bs', + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), ], ], /* |-------------------------------------------------------------------------- - | Sendmail System Path + | Global "From" Address |-------------------------------------------------------------------------- | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. + | 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. | */ - 'sendmail' => '/usr/sbin/sendmail -bs', + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], /* |-------------------------------------------------------------------------- @@ -140,17 +89,4 @@ ], ], - /* - |-------------------------------------------------------------------------- - | Log Channel - |-------------------------------------------------------------------------- - | - | If you are using the "log" driver, you may specify the logging channel - | if you prefer to keep mail messages separate from other log entries - | for simpler reading. Otherwise, the default channel will be used. - | - */ - - 'log_channel' => env('MAIL_LOG_CHANNEL'), - ];