Mailgun: Messages "Accepted" but taking long time to be delivered (or not being delivered)

mailgun template variables
mailgun api
mailgun login
mailgun click tracking
mailgun message-id
mailgun-js
mailgun api status
mailgun domain

I'm using Mailgun for a site I maintain, usually Mailgun works great, but I am encountering a strange problem. My script calls the HTTP API to send messages using Mailgun, these then show up in my log as being "accepted", but then take a very long time to be "delivered", often failing to be delivered at all and simply remaining as "accepted". Has anyone experienced a similar error or could anyone suggest a way to fix it? I'm guessing it's in the arguments supplied to the API but I can't for the life of me figure out the problem.

The problem exists for different recipient domains and different times of day.

The JSON log of a problematic message is below. I have, of course, changed addresses and domains.

{
    "tags": [], 
    "timestamp": 1411498829.247304, 
    "envelope": {
        "targets": "my-own-email@address.com", 
        "transport": "", 
        "sender": "noreply@the-site-in-question.com"
    }, 
    "recipient-domain": "address.com", 
    "event": "accepted", 
    "campaigns": [], 
    "user-variables": {}, 
    "flags": {
        "is-authenticated": true, 
        "is-system-test": false, 
        "is-test-mode": false
    }, 
    "message": {
        "headers": {
            "to": "my-own-email@address.com", 
            "message-id": "20140923190027.112157.29352@the-site-in-question.com", 
            "from": "\"the-site-in-question.com\" <noreply@the-site-in-question.com>", 
            "subject": "Dom, your password was reset."
        }, 
        "attachments": [], 
        "recipients": [
            "my-own-email@address.com"
        ], 
        "size": 556
    }, 
    "recipient": "my-own-email@address.com", 
    "method": "http"
}

Whenever a message shows as "Accepted" in the Mailgun logs this indicates that Mailgun has accepted the message and queued it for delivery. The message should be delivered fairly quickly, however it can be queued for a bit of time if you submitted a large amount of messages at once or if the recipient ESP is throttling messages from the IP/domain on your account.

I'd recommend opening a support ticket via your Mailgun account and provide some of the message-ID's so the support team can investigate the exact cause of these delays once the message is submitted to Mailgun.

User Manual, Mailgun announces the ability to view your messages with the events API in 2016​. Read more - Mailgun announces the ability to view your messages with the events API in 2016. Read more -

If this is happening regularly, it is very likely Mailgun has you on one of their low-tier IP addresses. I imagine this is the default for free accounts, since they don't want to "pollute" their good addresses with new users who may not be serious / legit.

You can check the "quality" of the IP address at a site like Sender Score. Find this line in the Mailgun log of a delivered message:

"sending-ip": "XXX.XX.XXX.XXX"

If Sender Score shows a score in the 70s, that's your problem. Send Mailgun a support ticket, as Chris suggested, and see if they can get you onto a higher quality IP address. I did so and my emails are now being sent from an IP address with a score in the 90s. Haven't had a single delay since.

How To View Your Messages With Mailgun, Mailgun assembled a MIME message. Added the log entries to our full text search index. Delivered the email. You can find your private API key on your dashboard. Developers and product teams love using Mailgun to communicate with their users Based on real customer reviews, G2 Crowd named us the #1 transactional email software. Learn how our customers achieved a 1350% increase in sending speed, 817% increase in unique click rate, and other great results.

For guys using the default Mailgun domain who will end up here like I did:

Mailgun did log my email as 'accepted' and 'delivered', however there was no email received in my inbox.

To fix this, you need to authorize the recipient email address: Read More Here

How to start sending email, Email clients say “sent via mailgun.us” with messages I send. How do I get rid How do I send the same message to multiple users using Mailgun? I am getting  Mailgun will properly assemble the MIME message and send the email to each of your users individually. That makes sending large volumes of email a lot faster and a lot less resource intensive.

FAQ, Webhooks · Mailgun Regions · Postman Integration · Messages · Sending · Retrieving Stored Messages · Deleting Stored Messages · Examples · Domains. When you’re looking for a free email sending service, you want something that delivers. Mailgun offers a free solution that makes it easy to take care of your important marketing and transactional emails and improve your deliverability. Get your first 10,000 emails and 100 email validations free every month.

API Reference, Your domain needs Mailgun MX records to handle inbound messages. When a message is received, Mailgun evaluates the filter expression against it. Each route consists of a filter expression and an action. When a message is received, Mailgun evaluates the filter expression against it. If the expression is true, the action is executed. Regular expressions can be used to match against message recipients or arbitrary headers such as subject.

How to start receiving inbound email, We receive a lot of requests from Mailgun customers for the ability to view their messages for a variety of reasons including why a message failed,  If you care about delivery (and you should), Mailgun offers high reliability as it’s designed to handle transactional email very well. You can set up multiple domains and choose if you want to share IPs or build your own reputation.

Comments
  • This happens pretty regularly with Mailgun unfortunately. Having to open a support ticket every time an IP gets throttled isn't that helpful.
  • It's now May 2016 and this is still an issue. It's not a reputation issue because my app sent out emails after the delayed one and those email were delivered instantly. But once in a while a random message takes 2-3 hours to be delivered.
  • In my case one-liner mails sent from command line get delivered immediately, but full HTML emails submitted via API are taking forever.
  • Sender Score is for companies; anything for individual users?
  • use talosintelligence.com for checking IP or domain reputation...