I’ve been using Mailgun to handle email sending for my website and it usually works fine. However, I’m running into a weird issue lately. When my code sends emails through the Mailgun HTTP API, the messages get marked as “accepted” in the logs, but then they either take forever to actually get delivered or sometimes don’t get delivered at all. They just stay stuck in the “accepted” status.
This happens with different email providers and at various times throughout the day, so I don’t think it’s a timing issue. I suspect there might be something wrong with the parameters I’m sending to the API, but I can’t figure out what’s causing it.
Has anyone else run into this kind of problem? Any ideas on what might be going wrong?
Here’s an example of what the webhook data looks like for one of these stuck messages:
{
"event": "accepted",
"timestamp": 1411502156.834721,
"recipient": "[email protected]",
"recipient-domain": "example.org",
"method": "http",
"envelope": {
"sender": "[email protected]",
"targets": "[email protected]",
"transport": ""
},
"message": {
"headers": {
"from": "MyWebsite Support <[email protected]>",
"to": "[email protected]",
"subject": "Password Reset Request",
"message-id": "[email protected]"
},
"size": 423,
"recipients": [
"[email protected]"
],
"attachments": []
},
"flags": {
"is-test-mode": false,
"is-system-test": false,
"is-authenticated": true
},
"user-variables": {},
"campaigns": [],
"tags": []
}