# Error when send email to segments greater than 300 thousand with cron jobs

**URL:** https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471
**Category:** General Discussion
**Created:** [May 15, 2021, 1:02pm UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471 "2021-05-15T13:02:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tfelix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tfelix/32/2709_2.png) [@tfelix](https://forum.mautic.org/u/tfelix)
#### Post date: [May 15, 2021, 1:02pm UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471/1 "2021-05-15T13:02:44Z")

</div>

Hello!

I have a segment with 300 thousand people.

When I try to send a segment email (automatically trough cron job) to these people my Mautic crash ( error bellow).

When I try to send the same email, to the same segment but toruhg the “send” button everything runs.

Anyone more have a similar problem?

`mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT ch.lead_id, fr.frequency_number, fr.frequency_time FROM ma_email_stats ch LEFT JOIN ma_lead_frequencyrules fr ON ch.lead_id = fr.lead_id WHERE (fr.channel = ? or fr.channel is null) AND ((ch.date_sent >= case fr.frequency_time when 'MONTH' then DATE_SUB(NOW(),INTERVAL 1 MONTH) when 'DAY' then DATE_SUB(NOW(),INTERVAL 1 DAY) when 'WEEK' then DATE_SUB(NOW(),INTERVAL 1 WEEK) end)) AND (ch.lead_id IN (424, 670, 716, 728, 788, 790, 949, 963, 1018, 1151, 1159, 1760....`

---

<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: [May 16, 2021, 4:56am UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471/2 "2021-05-16T04:56:56Z")

</div>

What are you frequency settings for email channel?

Configuration - Email settings - Default Frequency Rule

---

<div class="post-metadata">

### Author: ![bmontell](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bmontell/32/4130_2.png) [@bmontell](https://forum.mautic.org/u/bmontell)
#### Post date: [June 30, 2021, 12:09pm UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471/3 "2021-06-30T12:09:04Z")

</div>

I currently have in email configuration the frequency in 2 a day, but the error continues, NOTE only occurs when there are many contacts in the segment

---

<div class="post-metadata">

### Author: ![lucascostagyn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lucascostagyn/32/6627_2.png) [@lucascostagyn](https://forum.mautic.org/u/lucascostagyn)
#### Post date: [March 4, 2022, 4:43am UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471/4 "2022-03-04T04:43:22Z")

</div>

I have the same problem, did you manage to find a solution?

---

<div class="post-metadata">

### Author: ![carlosatfongo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/carlosatfongo/32/10223_2.png) [@carlosatfongo](https://forum.mautic.org/u/carlosatfongo)
#### Post date: [November 26, 2024, 7:48pm UTC](https://forum.mautic.org/t/error-when-send-email-to-segments-greater-than-300-thousand-with-cron-jobs/19471/5 "2024-11-26T19:48:50Z")

</div>

I have this problem as well. did you find a solution?
