# Email Queue's and Sending Limits - SMTP

**URL:** <https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [September 19, 2024, 11:16pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551 "2024-09-19T23:16:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 19, 2024, 11:16pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/1 "2024-09-19T23:16:15Z")

</div>

My Mautic version is: 4.4  
My PHP version is: 8.0  
My Database type and version is: MySQL 8.0

Hi, after reading the docs I realized I completely misunderstood how queue’s and frequency rules work, and now I have even more questions. lol.

 ![2024-09-20_01-45-32](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e8d69201d170d238aee07961555bcde5eb297f62.png)

I thought that these settings were for how many emails and how often they are sent, and to set limits on the number of emails I want the system to sent per day. Then I noticed that I was getting bounce issues since the emails that mautic was trying to send from the spool were too old.

So my question is, what settings and how should I sent them up if I want mautic to send a maximum of 50 emails per day (not frequency for how often someone gets an email, but a total number of outgoing emails to all recipients), and I need the emails to be fresh (meaning not collecting virtual dust in spool and then getting rejected by the recipients server).

So here is my scenario… I have a segment with about 1000 contacts in it. I have created several template emails and made a campaign with them. This campaign essentially will run indefinitely, only the contacts in the segment/campaign will change. But I need them all going through the same motion. So I want 50 contacts to get emails today, another 50 to get emails tomorrow, another 50 to get emails the day after and so on. That part seemed to be fine and dandy, I had it sending one email per 30 minutes. But thats it processing the emails in the spool folder. But what happens is it creates 1000 emails and puts them in the spool folder so that by the time it get to the last one its several days old and gets rejected when its finally sent. I hope I explained that well.

How do I get it to spool up and email, then send it, then spool up the next email, then send it, etc.

Here are my current cron jobs:

```auto
0,15,30,45 * * * * php my-path-to-mautic/bin/console mautic:segment:update
5,20,35,50 * * * * php my-path-to-mautic/bin/console mautic:campaigns:update
10,25,40,55 * * * * php my-path-to-mautic/bin/console mautic:campaigns:trigger
* * * * * php my-path-to-mautic/bin/console mautic:emails:send
* * * * * php my-path-to-mautic/bin/console mautic:broadcast:send
*/6 * * * * php my-path-to-mautic/bin/console mautic:email:fetch
*/12 * * * * php my-path-to-mautic/bin/console mautic:import
0 2 * * 0 php my-path-to-mautic/bin/console mautic:unusedip:delete
0 3 * * 0 php my-path-to-mautic/bin/console mautic:maintenance:cleanup

```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2024, 10:17am UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/2 "2024-09-20T10:17:48Z")

</div>

Hi, here is a video for Mautic4:

[![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/44af713b74f2b3072d1812a03cfd5a2d33b32c8f.jpeg "This Is How Email Sending Works In Mautic") ](https://www.youtube.com/watch?v=fJcen6XDuEc)

To sum up: if you want to send 50 emails / day, you can still create 1000 emails at once.  
(Make sure you are not creating more then you can actually send until the next email is scheduled for your contact)

50 emails / day being sent only during office hours (8-17 for example) is apprx 6 emails / hour, which is 1 email / 10 min.

In other words you need to fire your cron every 10 min and make sure it only sends 1 email.

The cron would look like this:

`*/10 8-17 * * * php path/bin/console mautic:emails:send --message-limit=1`

---

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 20, 2024, 12:13pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/3 "2024-09-20T12:13:49Z")

</div>

@joeyk Thanks! I already watched this video a few times, its been very helpful. Perhaps you can clarify one more thing for me. At what point are emails created and added to the spool? Is it when the campaign gets triggered? and how can I limit the amount of emails to get added to the spool at a time?

```auto
php /path/to/mautic/bin/console mautic:campaigns:trigger

```

Also unrelated question, what do these two cron jobs do and should I add them for when I new add contacts to the campaign?

```auto
php /path/to/mautic/bin/console mautic:campaigns:update
php /path/to/mautic/bin/console mautic:campaigns:process

```

---

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 20, 2024, 2:53pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/4 "2024-09-20T14:53:57Z")

</div>

Also, just remembered, with the way its messing with the statistics. Its shows that all those emails are sent, when they are actually not sent yet.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2024, 2:55pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/5 "2024-09-20T14:55:03Z")

</div>

Hello!

If you send a segment email, the spool is filled by:

`php /path/to/mautic/bin/console mautic:broadcast:send`

This moves contacts to the campaign, and updates the next step:  
`php /path/to/mautic/bin/console mautic:broadcast:update`

This will trigger email sending, and fill the spool with campaign emails:  
`php /path/to/mautic/bin/console mautic:broadcast:trigger`

This is usually not used:

> [@avori](#):
>
> ```auto
> php /path/to/mautic/bin/console mautic:campaigns:process
> 
> ```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2024, 2:55pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/6 "2024-09-20T14:55:51Z")

</div>

If you want to limit the ones above, you can limit by using --max-contacts=300, but this is not recommended, because you are not controlling which action is triggered.

---

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 20, 2024, 3:07pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/7 "2024-09-20T15:07:48Z")

</div>

Hello,

Hmmm. I see. But what if I did something like

```auto
*/10 8-17 * * * php /path/to/mautic/bin/console mautic:campaigns:trigger --batch-limit=1

```

Would that add 1 contact to the spool every 10 minutes starting at 8AM and ending at 5PM? If so, I think that would do what I want, am I right?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2024, 3:10pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/8 "2024-09-20T15:10:26Z")

</div>

Just simply - Why?  
This processes NOT 1 person / execution, but 1 person / batch during an execution.

If you want to limit then do --max-contacts=1

I have never tried this. And remember this not only referts to email sending but all campaign actions.

---

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 20, 2024, 3:18pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/9 "2024-09-20T15:18:35Z")

</div>

Ahh, well since it would affect all events in a campaign and not just emails then it will screw the other things up.

The Why - 2 reasons.

First, as I mentioned above, I was getting undelivered messages from the daemon saying that the email was rejected by the recipients server because it was too old.

Second, I’d like to address this:

 ![2024-09-20_18-11-57](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0ffcbb61192ffab3d60d17af9744f233dfc1b085.png)  
It shows 1086 sent, when in reality maybe only 2 send.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 20, 2024, 4:00pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/10 "2024-09-20T16:00:21Z")

</div>

Okay, that sucks. 🙂  
We need to fix this somehow. If you want we can take a look together in a call. Drop my a PM with your email.

---

<div class="post-metadata">

**Author:** ![avori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/avori/32/8000_2.png) [@avori](https://forum.mautic.org/u/avori)\
**Post date:** [September 21, 2024, 1:23pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/11 "2024-09-21T13:23:08Z")

</div>

Thanks for the offer, but I don’t think its necessary for me to take up your time at the moment. I’m running into some other issues with this fresh mautic install as well. So I wanna try to figure all this stuff out first myself.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 21, 2024, 1:26pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/12 "2024-09-21T13:26:54Z")

</div>

No worries, good luck!

---

<div class="post-metadata">

**Author:** ![gandhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gandhi/32/13476_2.png) [@gandhi](https://forum.mautic.org/u/gandhi)\
**Post date:** [February 7, 2025, 12:27pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/13 "2025-02-07T12:27:23Z")

</div>

“I have used this SparkPost plugin ([sparkpost-plugin/README.md at 0d45196494bdfe6796f301a53e0c238f0f793bd1 · ts-navghane/sparkpost-plugin · GitHub](https://github.com/ts-navghane/sparkpost-plugin/blob/0d45196494bdfe6796f301a53e0c238f0f793bd1/README.md)) for my campaign. I added 5 contacts, but the email was delivered to only 1 contact. However, the system shows that 5 emails were sent.”

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [February 7, 2025, 2:48pm UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/14 "2025-02-07T14:48:36Z")

</div>

Hi, can you share mautic version? Are you using a queue?

---

<div class="post-metadata">

**Author:** ![gandhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gandhi/32/13476_2.png) [@gandhi](https://forum.mautic.org/u/gandhi)\
**Post date:** [February 10, 2025, 6:20am UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/15 "2025-02-10T06:20:43Z")

</div>

Thank you for your reply. I am using Mautic version 5.4.35 and have implemented a queue system for processing tasks efficiently.

---

<div class="post-metadata">

**Author:** ![gandhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gandhi/32/13476_2.png) [@gandhi](https://forum.mautic.org/u/gandhi)\
**Post date:** [February 13, 2025, 5:27am UTC](https://forum.mautic.org/t/email-queues-and-sending-limits-smtp/33551/16 "2025-02-13T05:27:12Z")

</div>

Hello,

I am using Mautic 5 and PHP. I have resolved the issue where not all emails were being sent, and now my campaigns successfully send emails to all recipients.

I have a question regarding email opens and clicks. Can I get the open and click counts through SparkPost, and can Mautic display that data?
