# Unable to send segment emails (mailgun)

**URL:** <https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684>\
**Category:** Product Support\
**Created:** [May 31, 2021, 11:27pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684 "2021-05-31T23:27:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendanw](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brendanw/32/1341_2.png) [@brendanw](https://forum.mautic.org/u/brendanw)\
**Post date:** [May 31, 2021, 11:27pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/1 "2021-05-31T23:27:38Z")

</div>

**Your software**  
My Mautic version is: 3.2.5  
My PHP version is: 7.2.24  
My Database type and version is: MySQL

**Your problem**  
My problem is:  
I am unable to send segment emails via mailgun - emails are set to queue, not immediate. I have confirmed there is a publish start and end date (multiple days apart for testing purposes) for my segment emails.

When I send test emails, they work fine and I can see them in mailgun’s logs and receive the email. So the connection to mailgun is working.

Emails move from “pending” to “sent” according to the colored boxes on the email channels page. But they do not show up in mailgun and are not received.

These are my cron jobs:  
\*/15 \* \* \* \* php /var/www/html/info.X.com/bin/console mautic:segments:update  
5,20,35,50 \* \* \* \* php /var/www/html/info.X.com/bin/console mautic:campaigns:update  
10,25,40,55 \* \* \* \* php /var/www/html/info.X.com/bin/console mautic:campaigns:trigger  
\*/15 \* \* \* \* php /var/www/html/info.X.com/html/bin/console mautic:email:send  
\*/5 \* \* \* \* php /var/www/html/info.X.com/html/bin/console mautic:import  
3-59/15 \* \* \* \* php /var/www/html/info.X.com/html/bin/console mautic:email:process --env=prod  
\*/15 \* \* \* \* php /var/www/html/info.X.com/html/bin/console mautic:broadcast:send

Steps I have tried to fix the problem:  
Other than verifying that the connection to mailgun is working and confirming the cron jobs, I am not sure what to try next.

Any ideas?

\*more info, the crons appear to be working as I can confirm imports and segments are updating based on those cron jobs. So I would assume (loosely) that the mail crons are working as well.

---

<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:** [June 1, 2021, 12:42pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/2 "2021-06-01T12:42:01Z")

</div>

can you check if your emails are in the queue? Check folder /var/spool

Is it empty?

---

<div class="post-metadata">

**Author:** ![brendanw](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brendanw/32/1341_2.png) [@brendanw](https://forum.mautic.org/u/brendanw)\
**Post date:** [June 1, 2021, 6:14pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/3 "2021-06-01T18:14:35Z")

</div>

Hi Joeyk, thank you for your response.

The /var/spool folder in the mautic install has .message files in it.

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [June 1, 2021, 6:47pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/4 "2021-06-01T18:47:00Z")

</div>

This may help

> [@Issues with mail provider for tracking and mail delivery](https://forum.mautic.org/t/issues-with-mail-provider-for-tracking-and-mail-delivery/19589/19):
>
> swiftmailer:spool:send Sends emails from the spool Here is the output for the help command for this function Description: Sends emails from the spool Usage: swiftmailer:spool:send [options] Options: –message-limit=MESSAGE-LIMIT The maximum number of messages to send. –time-limit=TIME-LIMIT The time limit for sending messages (in seconds). –recover-timeout=RECOVER-TIMEOUT The timeout for recovering messages that have taken too long to send (in seconds)…

---

<div class="post-metadata">

**Author:** ![brendanw](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/brendanw/32/1341_2.png) [@brendanw](https://forum.mautic.org/u/brendanw)\
**Post date:** [June 1, 2021, 10:17pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/5 "2021-06-01T22:17:37Z")

</div>

Thanks EJL, that fixed the issue

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [June 1, 2021, 11:42pm UTC](https://forum.mautic.org/t/unable-to-send-segment-emails-mailgun/19684/6 "2021-06-01T23:42:03Z")

</div>

Awesome. Glad I could help.
