# Changing how Mautic 5 handles email from send immediately to queue

**URL:** <https://forum.mautic.org/t/changing-how-mautic-5-handles-email-from-send-immediately-to-queue/30374>\
**Category:** Product Support\
**Created:** [January 2, 2024, 8:58pm UTC](https://forum.mautic.org/t/changing-how-mautic-5-handles-email-from-send-immediately-to-queue/30374 "2024-01-02T20:58:52Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![jet1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jet1/32/13361_2.png) [@jet1](https://forum.mautic.org/u/jet1)\
**Post date:** [February 22, 2024, 12:47pm UTC](https://forum.mautic.org/t/changing-how-mautic-5-handles-email-from-send-immediately-to-queue/30374/12 "2024-02-22T12:47:32Z")

</div>

To debug, I recommend to comment out your cron commands and launch everything directly from terminal.

1. Make sure the particular email is “published” and date is set to a moment in past:

 ![2024-02-22 at 13.37](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c09700fbafcc26516d81c37a0768ddd7ab5b75d7.jpeg)

1. Make sure your “queue” settings are set to doctrine  

2. run emails generator

```auto
php -d memory_limit=-1 ./bin/console mautic:broadcasts:send --batch=30 --limit=2000 --id=[YOUR-EMAIL-ID]

```

in terminal, from mautic working dir (note that you need to get your email id from mautic emails list - this arg helps to isolate sending and debugging for 1 particular campaign)

This will start feeding your queue with generated emails.  
If the process exists fast - this means you have a problem with your email generation setup. If it starts working - you will see it, it takes many seconds.

1. Run actual email sending (you can start another terminal instance for this):

```auto
php ./bin/console messenger:consume email --memory-limit=8280M -vv

```

 ![2024-02-22 at 13.45](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f7b7cd02804da213a61748a6e449bdfad41510ef.png)

So, you need _two_ processes running when you want to send queued email campaign: first one is generating emails and putting it into queue; another one is working on the queue.

If it works from terminal, you can start moving these commands either into crontab or daemon like supervisorctl [(my preferred method).](https://forum.mautic.org/t/messenger-consume-redis-concurrency-for-better-queued-emails-performance-error-could-not-acknowledge-redis-message/30855/7)

---

_[View the full topic](https://forum.mautic.org/t/changing-how-mautic-5-handles-email-from-send-immediately-to-queue/30374)._
