一、配置 .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.163.com
MAIL_PORT=465
MAIL_USERNAME=1392XXXX@163.com
MAIL_PASSWORD=XXXXX //非登陆密码
MAIL_FROM_ADDRESS=1392XXXX@163.com
MAIL_FROM_NAME=1392XXXXX@163.com
MAIL_ENCRYPTION=ssl
二、配置config/mail.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| 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", "mandrill", "ses",
| "sparkpost", "log", "array"
|
*/
'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.163.com'),