Mailgun is a developer favourite with solid delivery and detailed logs. There is one thing to get right, and almost every failed Mailgun setup comes down to it: the region.
Step by step:
- Create an account at mailgun.com.
- Add your sending domain. Mailgun suggests a subdomain such as mail.yourdomain.com, which is a good idea: it keeps your marketing reputation separate from your everyday email.
- Add the DNS records it lists, which cover SPF, DKIM and tracking.
- Wait for the domain to show as verified.
- Create a Sending API key.
- In ResultsAiX Mailer, open Delivery, then Sending, and add a connection.
- Choose Mailgun, then fill in three things: the API key, the exact sending domain, and the region.
- Save and send yourself a test.
The region trap:
Mailgun runs separate services in the US and the EU. A domain created in the EU does not exist in the US, and a key from one is meaningless to the other. If your Mailgun dashboard says EU anywhere, choose EU in the Region box on the connection. Symptoms of getting it wrong are a key that looks perfect and mail that is refused every single time.
The domain box:
Put the sending domain exactly as Mailgun shows it. If you set up mail.yourdomain.com, then mail.yourdomain.com is what goes in the box, not yourdomain.com. Your From address should be on that same domain.
Keep it healthy:
- Set Daily limit to your plan allowance so a big broadcast paces itself.
- Use Warmup on a new account before a large send.
- Mailgun's logs are excellent. When something bounces, its log tells you exactly what the receiving server said.
Common problems:
- Everything refused although the key is right: wrong region.
- Refused with a domain error: the Domain box does not match the sending domain, or the domain is not verified yet.