Search code examples
phpemaillaravel-5.1queueing

Laravel 5.1 - Delayed Message Queueing


I'm trying to send a delayed message but it's not working, it gets into the jobs table but it stays there. Here is my code:

Mail::later(5, 'emails.test', ['testVar' => 'hello'], function ($message){
   $message->to('*[email protected]', 'Someone');
   $message->subject('Subject');        
});

*: i use a real address

emails.test:

<p>  This is a test, an email test. </p>

.env:

QUEUE_DRIVER=database

When i use send instead of later, the message is sent perfectly.

Do i have to modify something more to get this to work?


Solution

  • I was not using this command to run the queue listener: php artisan queue:listen. Now it is working good. Thank you, nathanmac