-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unauthorized Error when calling mg.messages.create() #411
Comments
I am getting the same issue |
same |
So I came across one Vercel article, which suggests that on the free plan, we don't have the option to create custom IP for our domains as Vercel deployments use a range of IP addresses that can't be easily specified for Mialgun's IP Allowlist. So, we have two options:
|
I resolved the 401 Unauthorized error by adding |
Running into the same issue testing locally. When running the |
I have a Next.js 14 project deployed on Vercel, where I've integrated the Mailgun API to send emails using this package. The integration works fine locally. However, after deploying to production on Vercel, I'm consistently encountering an "Unauthorized" error when attempting to send emails via the Mailgun API.
I've already added Vercel's IP, i.e. 76.76.21.21 to our domain's whitelist on Mailgun, but still no luck.
I've thoroughly checked and verified the API keys, environment variables and permissions and they're all fine. I've also included my code below for reference.
I've also attached a screenshot below for reference.
The text was updated successfully, but these errors were encountered: