Mailgun not working periodically
I'm using Mailgun as the email provider, and some of my users reported that they cannot receive sign-up emails.
- I checked my Mailgun dashboard and found out 30%+ of the emails are "Failed"
- I tried with my own Gmail and Outlook email addresses. It sent to my Gmail, however not Outlook address.
- The Outlook email even didn't go to the spam folder.
Anyone experiencing the same issue? Why would Mailgun fails sending email?

2 Replies
Hi @William Jin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I understand you're having issues with Mailgun as your email provider in your Wasp application. This is a common challenge with email delivery services.
Based on the information provided, there are several potential reasons why Mailgun might be failing to deliver emails:
1. Email Deliverability Issues: Mailgun, like other email service providers, can face deliverability challenges. Different email providers (like Outlook) might have stricter spam filtering than others (like Gmail).
2. Rate Limiting: Wasp implements rate limiting for sign-up requests (1 request per minute per email address) to prevent spamming, which could potentially affect your email delivery if users are trying to sign up multiple times in quick succession.
3. Configuration Issues: Make sure your Mailgun API key and domain are correctly set up in your
.env.server
file as described in the Wasp documentation on email providers.
Some suggestions to troubleshoot:
- Check your Mailgun logs for specific error messages related to the failed deliveries
- Verify your domain settings in Mailgun
- Consider using SMTP instead of the API if you continue having issues, as Wasp supports SMTP as well: SMTP Provider documentation
- For development purposes, you could temporarily switch to the Dummy provider to verify your application logic is working correctly
This appears to be more of a Mailgun-specific issue rather than a Wasp issue, as Wasp is correctly passing your email requests to Mailgun. You might want to contact Mailgun support directly to investigate why some emails are being rejected, especially to Outlook addresses.
Kapa AI
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @William Jin, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Given that Wasp is not sending emails itself but (in your case) through Mailgun, I think probably it's one of the following three factors:
1. the content and cadence of the emails themselves
2. your domain configuration in mailgun
3. mailgun's own configuration
Outlook is famously fussy with the email it will allow, but Mailgun is one of the leading providers so I'd rule out option (3). I'd try to see if Mailgun gives you any insight in the Failed statistics. You can also try using tools like Mail Tester's analyzer, that will tell you what common filters might see as spammy from your emails (both from options (1) and (2)). Ultimately, I don't know of many more workarounds, but you can probably look at Mailgun's docs or contact their support for help.
Wrong testing address
You sent us an email? Check here if it passed our tests