I’ve been working with Mailgun’s email service for my web application and normally everything runs smoothly. However, I’m running into a frustrating issue lately. When I send emails through their HTTP API, the messages get marked as ‘accepted’ in the logs right away, but then they either take forever to actually get delivered or sometimes never get delivered at all. They just stay stuck in that ‘accepted’ state.
This happens across different email providers and at various times throughout the day, so it doesn’t seem to be related to any specific domain or time constraints. I suspect there might be something wrong with how I’m formatting the API request parameters, but I can’t pinpoint what exactly is causing this behavior.
Has anyone else run into similar delivery issues with Mailgun? Any suggestions on what might be causing this or how to troubleshoot it further?
Here’s an example of what the webhook log looks like for one of these problematic messages:
check your mailgun account status first - sometimes they put accounts under review without warning which causes this exact behavior. had this happen to me last month and emails would just sit in ‘accepted’ limbo for hours. contact their support team directly because this isnt usually an api formatting issue
This sounds like you might be hitting Mailgun’s internal rate limiting or queue processing delays. I’ve dealt with this exact scenario before and found that increasing the time between API calls helped significantly. The ‘accepted’ status just means Mailgun received your request successfully, but their internal delivery engine processes messages in batches based on various factors including your account tier and historical sending volume. Check your Mailgun account settings for any sending limits that might be configured. Another thing that worked for me was implementing exponential backoff in my application when making API requests. If you’re sending high volumes rapidly, Mailgun queues them internally which can cause those delivery delays you’re experiencing. Try reducing your sending rate temporarily to see if that improves delivery times. Also make sure you’re monitoring the subsequent webhook events like ‘delivered’ or ‘failed’ rather than just ‘accepted’ to get the complete picture.
I encountered something very similar about six months back and it turned out to be related to my domain reputation rather than the API formatting itself. Even though Mailgun accepts the message initially, they might be throttling delivery based on sending patterns or recipient engagement metrics. What helped me was checking the actual delivery stats in the Mailgun dashboard rather than just relying on webhook logs. You should also verify if your domain has proper SPF and DKIM records set up correctly. In my case, some ISPs were silently dropping messages even after Mailgun marked them as accepted. Try sending a few test emails to different providers like Gmail, Yahoo, and Outlook to see if the pattern is consistent across all of them. Also worth checking if you have any suppressions or bounces that might be affecting your sender score.