I’ve encountered this issue before, and it’s usually related to Mailgun’s sandbox domain restrictions. By default, Mailgun provides a sandbox domain for testing, which has limitations on recipients.
To resolve this, you need to set up and verify your own domain in Mailgun. Once that’s done, replace ‘my-domain’ in your code with your actual verified domain.
Also, ensure your mailing list is properly set up in Mailgun. If you’re using a sandbox domain, you’ll need to add each recipient to the authorized recipients list in your Mailgun dashboard.
Lastly, double-check that your API key is correct and has the necessary permissions. Sometimes, API key issues can cause similar errors.
If you’ve done all this and still face issues, I’d recommend reaching out to Mailgun support. They’re usually quite helpful in troubleshooting these kinds of problems.
Have you checked your Mailgun account status? Sometimes these errors pop up when your account isn’t fully verified or if you’ve hit sending limits. It’s worth logging into your Mailgun dashboard to ensure everything’s in order.
Another thing to consider is the mailing list itself. Make sure it’s properly set up and that all the email addresses on it are valid. Invalid addresses can cause issues with bulk sends.
Also, don’t forget to review Mailgun’s documentation on sending to mailing lists. There might be specific parameters or formatting required that you’re missing in your current code.
If none of that helps, you might want to try sending a test email to a single address first, just to isolate whether the problem is with your code or with the mailing list functionality.
hey mate, ive seen this before. check ur mailgun settings - u might be using a sandbox domain. those have restrictions on who u can send to. switch to a verified domain and it should work. also make sure ur API key is good. if ur still stuck, hit up mailgun support. they know their stuff