mardi 7 avril 2020

Laravel 5.2 - Email not sent scheduled command

I need send an email some hours before an appointment occurs (so I need use CRON but it is off topic).

Usually in my controller I use an internal method of mine which uses Mail::send($view, $data, ...) and it works.

However when I call the same internal method from the command line via php artisan my:command which is registered in kernel I get :

[Swift_TransportException] 
Connection could not be established with host ssl0.ovh.net [Connection refused #111]

Please note that on my dev computer the above command runs smoothly.

The project .env part concerning email consists in :

MAIL_DRIVER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=465
MAIL_USERNAME=myusername
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl

So it seems ssl0.ovh.net cannot be called from command line. But how can I make the schedule command work ?

Any help greatly appreciated :-)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire