预期的响应代码为250,但代码为“ 530”,消息为“ 530 5.7.0”,必须首先发出STARTTLS命令。

时间:2018-06-30 14:21:23

标签: laravel authentication reset-password

我使用了Laravel身份验证,并且在“重置密码”中我想将“重置链接”发送到电子邮件。 我的.env在这里:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=MyPassword
MAIL_ENCRYPTION=null

还有我的mail.php:

<?php

 return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587);
'from' => [
    'address' => env('MAIL_FROM_ADDRESS', 'hanieasemi76@gmail.com'),
    'name' => env('MAIL_FROM_NAME', 'hanie'),
],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'stream' => [
    'ssl' => [
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
],

'markdown' => [
    'theme' => 'default',

    'paths' => [
        resource_path('views/vendor/mail'),
    ],
],
];

然后打开我的gmail的两步验证,但是现在当我想发送电子邮件时,出现此错误Expected response code 250 but got code "530", with message "530 5.7.0 Must issue a STARTTLS command first. r7-v6sm5414781wrn.83 - gsmtp 我该如何解决?我的问题出在哪里?

0 个答案:

没有答案