Laravel default mail not working Laravel default mail not working laravel laravel

Laravel default mail not working


Okay, I'd give Yousef an ''Up One'', but my reputation is not high enough (seems broken). I had EXACTLY the same issue with my ISP in connecting to their smtp server. The only way I could FINALLY get an email through using laravel was to set the 'encryption' value to nothing (ie just as in the post above). Every other combination of port-change, account-change, etc. resulted in a laravel exception. I tried using my gmail account and credentials with no luck.

The only combination of settings that finally worked was to use

'host' => 'smtp.your-domain','port' => 587, 'encryption' => '','username' => 'Your-account@Your-domain','password' => 'your-password for Your-account',...


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.


try removing tls encryption by setting it to

'encryption' => '',

i had a similar issue, and the tls was it.