# Segment Emails not Sending out

**URL:** <https://forum.mautic.org/t/segment-emails-not-sending-out/33987>\
**Category:** Mautic 5 Install/Upgrade Support\
**Tags:** mautic-5\
**Created:** [October 30, 2024, 9:58pm UTC](https://forum.mautic.org/t/segment-emails-not-sending-out/33987 "2024-10-30T21:58:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![guidedfree](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/guidedfree/32/12725_2.png) [@guidedfree](https://forum.mautic.org/u/guidedfree)\
**Post date:** [October 30, 2024, 9:58pm UTC](https://forum.mautic.org/t/segment-emails-not-sending-out/33987/1 "2024-10-30T21:58:58Z")

</div>

**Your software**  
My Mautic version is: 5.1.0  
My PHP version is: 8.1.30  
My Database type and version is: 10.6.19-MariaDB

**Your problem**  
Segment emails are not being sent out. This is a newish install and my first attempt at segment emails. Campaign emails and test emails work without issue. I am using doctrine for the queue.

Steps I took to create the segment email:

1. Created a segment and confirmed contacts are in it. I have 3 contacts
2. Created a segment email;  
gave it a subject and internal name,  
assigned the contact segment to it  
Available to Yes and set a start time and end time within the time frame.
3. Sent “Send Example” email and it works without issue.

The email dashboard shows 3 Pending, 0 Sent, 0 Read, 0% Read  
 ![Screen Shot 2024-10-30 at 4.28.27 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/optimized/2X/c/c7f2b046109da30d7ed34d19992b4f287ec889f8_2_690x46.png)

If I do the dropdown and send, nothing happens. afterwards, hovering over the send email button than displays the message: “Email is sending in the background. Sending from the browser is blocked to prevent duplicate emails.”

**Logs:**  
I have enabled debugging, but the logs are still empty for the Segment ID Number (SegmentId: 11 is the ID number of the segment email)  
Below is part of the mautic\_prod-2024-10-30.php logs. prod-2024-10-##.php has not been appended in several days and has nothing relevant to this issue.

```auto
[2024-10-30T21:00:05.981921+00:00] mautic.DEBUG: Segment QB: Query took: 00:00:00.002128, Result count: 3 {"segmentId":8} {"hostname":"ngx111.domain.com","pid":3896040}
[2024-10-30T21:00:05.982012+00:00] mautic.INFO: Segment QB - No new leads for segment found {"hostname":"ngx111.domain.com","pid":3896040}
[2024-10-30T21:00:05.982724+00:00] mautic.DEBUG: Segment QB: Orphan Leads Count SQL: SELECT count(leadIdPrimary) count, max(leadIdPrimary) maxId, min(leadIdPrimary) minId FROM (SELECT DISTINCT orp.lead_id as leadIdPrimary, orp.lead_id as id, orp.leadlist_id FROM maut_lead_lists_leads orp WHERE (orp.leadlist_id = 8) AND (orp.manually_added = '0') AND (orp.lead_id NOT IN (SELECT l.id FROM maut_leads l WHERE ((EXISTS(SELECT null FROM maut_leads parb WHERE (l.id = parb.id) AND (EXISTS(SELECT null FROM maut_lead_lists_leads parc WHERE (parb.id = parc.lead_id) AND ((parc.leadlist_id = 5) AND ((parc.manually_added = 1) OR (parc.manually_removed = ''))))))) OR (EXISTS(SELECT null FROM maut_leads pard WHERE (l.id = pard.id) AND (EXISTS(SELECT null FROM maut_lead_lists_leads pare WHERE (pard.id = pare.lead_id) AND ((pare.leadlist_id = 1) AND ((pare.manually_added = 1) OR (pare.manually_removed = '')))))))) AND ((l.pkgtracking IS NOT NULL) AND (l.pkgtracking <> ''))))) sss {"segmentId":8} {"hostname":"ngx111.domain.com","pid":3896040}
[2024-10-30T21:00:05.983599+00:00] mautic.DEBUG: Segment QB: Query took: 00:00:00.000792, Result count: 3 {"segmentId":8} {"hostname":"ngx111.domain.com","pid":3896040}

```

**Steps I have tried to fix the problem:**  
Enabled Debugging  
Looking in my messenger\_messages queue in the DB, no messages appear.  
Sending test messages, reviewing my crontab:  
I noticed that the previous segment emails show pending emails and 0 sent as well.

```auto
*/20 * * * * /usr/local/bin/php /home/user/www/maut/bin/console mautic:segments:update > /dev/null
*/15 * * * * /usr/local/bin/php /home/user/www/maut/bin/console mautic:campaigns:update > /dev/null
0 * * * * /usr/local/bin/php /home/user/www/maut/bin/console mautic:campaigns:trigger > /dev/null
7 1 * * * /usr/local/bin/php /home/user/www/maut/bin/console mautic:custom-field:create-column > /dev/null
9 11,8 * * * /usr/local/bin/php /home/user/www/maut/bin/console mautic:webhooks:process > /dev/null
0 0 * * 0,3,5 /usr/local/bin/php /home/user/www/maut/bin/console mautic:iplookup:download > /dev/null
## Added - 8/28/24
*/10 * * * * /home/user/bin/consume_mautmail.sh >> /home/user/www/maut/var/logs/mautic_consume.log 2>&1

```

consume\_mautmail.sh essential contains this line:  
`/usr/bin/php /home/hysmor5/www/mkt/bin/console messenger:consume email --limit=45 --time-limit=480 --memory-limit=128M`
