Laravel default mail not working

前端 未结 6 922
再見小時候
再見小時候 2020-12-24 06:16

Im attempting to send a user activation email upon registration. I have a simple laravel site with registration and authentication. Upon registration, there are no errors, a

6条回答
  •  孤独总比滥情好
    2020-12-24 07:05

    Expanding on the answers above as they weren't working for me.

    The port you define has to correlate with the right type of encryption. As it turns out, ssl and tls are not equivalent and correlate to different ports.
    The default encryption setting in laravel is set on tls (port 587), but if you're using port 465, you need to change it to ssl.

    Google's smtp.gmail.com server is a good example of this:

    'host' => 'smtp.gmail.com',
    'port' => 465, 
    'encryption' => 'ssl',
    

    OR

    'host' => 'smtp.gmail.com',
    'port' => 587, 
    'encryption' => 'tls',
    

    Furthermore, port 587 doesn't mandate the use of encryption (more on that here). If you find that setting 'encryption' => '' works for you, it should raise a red flag as it may mean the smtp server you're using is not encrypting your emails.
    In this case, you should find alternative means of sending your emails.

提交回复
热议问题