I have a very weird situation sending emails from my Laravel project.
1 - Sending email to ANY address from a test function in HomeController works.
2 - Sending email to addresses that belong to any of my domains in the same hosting, run from Scheduler (php artisan schedule:run) works.
3 - Sending email to hotmail/gmail addresses, run from Scheduler does not work.
The test function in HomeController is exactly the same as the function in the Scheduler. I put logs everywhere, so I am sure the Mail function in the Scheduler is being called, there are no error logs at all, it just never arrives.
My mail config is smtp, port 587, tls encryption.
Any ideas of what could be wrong in the scheduler for hotmail/gmail addresses?
----------UPDATE---------
I found a workaround here https://laracasts.com/discuss/channels/general-discussion/42-email-not-being-sent-when-using-artisan-command
It says to basically replace the $_domain variable in AbstractSmtpTransport.php file, since it uses 127.0.0.1 by default.
However, I'm not sure what IP this is supposed to be using. Would it be my shared hosting IP address?