I can’t seem to get the email module to work. I get back the response, “Mailgun responded with Mailgun Magnificent API. Check configuration.”
On the mailgun side the domain is active and all DNS settings pass their checks. On the CC side I’ve got the secret key and the domain in place, and the API code per the documentation.
Also when I copy the sandbox URL the way you did in the screen cast without the https//: I get response the response “Forbidden” instead of “Mailgun Magnificent API.” The same is true when I use the coronium host url.
And you should be using the private api key they provide, including the “key-” prefix that is on it.
You also need to make sure you have set up an authorized recipient for testing. Click the “Domains” link at the top and then “Authorized Recipients” button.
This is my server-side api method:
function api.sendmail(input) local msg = core.email.new() msg:to("sendto-email-here") msg:from("from-email-here") msg:subject("Hello You") msg:text("I like to use Mailgun because it is a very cool service.") local resp, err = msg:send() if not resp then return core.error(err) end return resp end
Well, I thought I had tried all the setting permutations, but somehow going back over it one more time with these instructions did the trick. It is possible I was not including the “key-” element of the private key, hopefully anyone else who makes this mistake will stumble on this forum and save you a support cycle. Much appreciated as always, CC is amazing!
Also when I copy the sandbox URL the way you did in the screen cast without the https//: I get response the response “Forbidden” instead of “Mailgun Magnificent API.” The same is true when I use the coronium host url.
And you should be using the private api key they provide, including the “key-” prefix that is on it.
You also need to make sure you have set up an authorized recipient for testing. Click the “Domains” link at the top and then “Authorized Recipients” button.
This is my server-side api method:
function api.sendmail(input) local msg = core.email.new() msg:to("sendto-email-here") msg:from("from-email-here") msg:subject("Hello You") msg:text("I like to use Mailgun because it is a very cool service.") local resp, err = msg:send() if not resp then return core.error(err) end return resp end
Well, I thought I had tried all the setting permutations, but somehow going back over it one more time with these instructions did the trick. It is possible I was not including the “key-” element of the private key, hopefully anyone else who makes this mistake will stumble on this forum and save you a support cycle. Much appreciated as always, CC is amazing!