Mailgun Api isn't working

MTP

New Member
Hi guys,

I have tried to set up mailgun api on my mailwizz but it doesnt work:

Error:
  • Cannot create the permanent_fail webhook, reason: The endpoint you have tried to access does not exist. Check if the domain matches the domain you have configure on Mailgun.
Mailgun account is fully setup and STMP works perfectly.
Just cant get the API to work.

My mailgun acc is using infrastructure so my domain name should link should be:
https://api.mailgun.net/v3/MY DOMAIN NAME

I tried that and also tried:
https://api.mailgun.net/v3/MY DOMAIN NAME/messages

Does anyone know what I am doing wrong?

Capture.JPG
 
you should add your domain name (example.com) in "Domain name" field without api.mailgun.net...
 
Guys, I think you are all wrong. Look, I tested the API using powershell:

As you can see the URL (which in Mailwizz should be the domain) is: https://api.mailgun.net/v2/$($emaildomain)/messages

and not $emaildomain

Please can one of you try it out first.

function Send-MailgunEmail($from, $to, $subject, $body, $emaildomain, $apikey) {
$idpass = "api:$($apikey)"
$basicauth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($idpass))
$headers = @{
Authorization = "Basic $basicauth"
}
$url = "https://api.mailgun.net/v2/$($emaildomain)/messages"
$body = @{
from = $from;
to = $to;
subject = $subject;
text = $body
}
Invoke-RestMethod -Uri $url -Method Post -Headers $headers -Body $body
}

But of course I also tried entering just the domain name in the api but I get wrong credentials (but im using same creds as in the powershell script):
1643075879116.png
 
Last edited:
Guys I am such an idiot.

It is fixed now.

I was using a sender API key instead of the Mailgun Account API that controls all. And you all are right. Domain name should be "Domain_Name"
 
Hello, I have the same problem as you, I'm at a loss, what should I do?
Check if webhooks in mailgun account exists and are the same as the your webhook , you can see your webhook by clicking on the info button.
 
Check if webhooks in mailgun account exists and are the same as the your webhook , you can see your webhook by clicking on the info button.
Thanks for the answer, but I still haven't found a solution.I checked, there's only one sandbox and one of my domains, and I deleted all the webhooks for the sandboxes
 
Thanks for the answer, but I still haven't found a solution.I checked, there's only one sandbox and one of my domains, and I deleted all the webhooks for the sandboxes
Also you have the same error after you deleted all webhooks?
 
I have the same problem with my MailWizz. Don't know how to fix that.
The domain and API key seems to be correct because my Wordpress sends emails via MailGun using the same domain and API key.
 

Attachments

  • 05-18 19-48-42.png
    05-18 19-48-42.png
    58.6 KB · Views: 6
I was using a sender API key instead of the Mailgun Account API that controls all. And you all are right. Domain name should be "Domain_Name"
Maybe this is useful...

Cosmin
 
Back
Top