I have setup a new account and not verified my domain. I would like to test and confirm mail-send before proceeding with verification and adding payment information.
I have tried curl using the sandbox method and api key (including smtp). I have also tried to use my domain using the top account mail-address as recipient. But each time the send command (both curl and smtp) I get "Mailgun Magnificent API" response - but no mail is delivered. So far the Mailgun API does not look so Magnificent... I have gone through the documentation multiple times and cannot find what I might be doing wrong..
Any help is much appreciated.
Faced the same issue while sending emails via api by php curl. I solved it by changing API Base URL https://api.mailgun.net/v3/YOUR_DOMAIN_NAME to https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages. It's because their api is not only for sending. Hope this helps.
For anyone else trying to figure out what "Mailgun Magnificent API" means in a Mailgun HTTP 200-OK API response, it occurs when posting to https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/some/api/endpoint when /some/api/endpoint is not a valid Mailgun API endpoint.
There are several ways you could accidentally see this. Say your sender domain is "mg.example.com". All of these will respond with "Mailgun Magnificent API":
- Omitting the API endpoint:
https://api.mailgun.net/v3/mg.example.com(as noted in another response) - Misspelling the endpoint:
https://api.mailgun.net/v3/mg.example.com/massages(that should be messages with an e) - Including a
#after your domain:https://api.mailgun.net/v3/mg.example.com #/messages(perhaps you tried to add a# commentto your config file, but your config format doesn't support inline comments?) - Including an extra path after your domain:
https://api.mailgun.net/v3/mg.example.com/myapp/messages(maybe you're using a Mailgun client library and setMAILGUN_DOMAIN_NAME='mg.example.com/myapp'—the/myapppart doesn't belong in your domain name)
Note that you won't see "Mailgun Magnificent API" if YOUR_DOMAIN_NAME is not a valid sending domain you've registered with Mailgun. (In that case, Mailgun instead responds 404-Not Found).
来源:https://stackoverflow.com/questions/45255915/unable-to-send-mail-via-mailgun-over-api-or-smtp