简体   繁体   中英

Laravel: send password reset link

Problem . When I try to send password reset link with Laravel (v.5.2), i get this error message:

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 220 but got code "", with message ""

How can I fix this?

.env .

MAIL_DRIVER=smtp
MAIL_HOST=send.one.com
MAIL_PORT=465
MAIL_USERNAME=info@myemail.se
MAIL_PASSWORD=password
MAIL_ENCRYPTION=null

mail.php

'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'send.one.com'),
'port' => env('MAIL_PORT', 465),
'from' => ['address' => 'info@myemail.se', 'name' => 'donotreply'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',

Other info. I have my project on a shared host site called one.com. The project is quite small, and not much is changed from the Laravel installation. I uploaded it by copying it into the domain, and changed a few settings.

It could be many settings, my current suspicion would be the MAIL_ENCRYPTION=null . Have you tried setting it to MAIL_ENCRYPTION=ssl ? Since it's port 465, it might be neither null or tls (the env() fallback) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM