书架laravel不发送电子邮件

时间:2019-09-11 10:02:52

标签: php laravel smtp

当我尝试确认电子邮件书架时,出现以下消息:

  

需要电子邮件确认,但系统无法发送电子邮件。与管理员联系以确保电子邮件设置正确。

.env文件

APP_KEY=***
APP_DEBUG=true
APP_URL=***

Database details
DB_HOST=localhost
DB_DATABASE=***
DB_USERNAME=***
DB_PASSWORD=***

Mail sending options
MAIL_FROM_ADDRESS=nestle9412@gmail.com
MAIL_FROM_NAME="Confirm E-mail adress"

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=nestle9412@gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=null

我也尝试过tls / ssl。 邮件加密:

return [

// Mail driver to use.
// Options: smtp, mail, sendmail, log
'driver' => env('MAIL_DRIVER', 'smtp'),

// SMTP host address
'host' => env('MAIL_HOST', 'smtp.gmail.com'),

// SMTP host port
'port' => env('MAIL_PORT', 587),

// Global "From" address & name
'from' => [
    'address' => env('MAIL_FROM', 'nestle9412@gmail.com'),
    'name' => env('MAIL_FROM_NAME','Wiki ITS')
],

// Email encryption protocol
'encryption' => env('MAIL_ENCRYPTION', 'tls'),

// SMTP server username
'username' => env('nestle9412@gmail.com'),

// SMTP server password
'password' => env('***'),

'pretend' => false,

// Sendmail application path
// 'sendmail' => '/usr/sbin/sendmail -bs',

// Email markdown configuration
'markdown' => [
    'theme' => 'default',
    'paths' => [
        resource_path('views/vendor/mail'),
    ],
],
];

怎么了?

0 个答案:

没有答案