email module

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. 

Any thoughts?

Thanks!

Hi,

Have you tried using the Mailgun sandbox domain as a test?

-dev

Yes, I get the same result. Spent quite a while on every credential and end point permutation I could think of :slight_smile:

Hi,

I’ll take a look, had passed tests the other day.

-dev

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.

Hi,

I just ran a test and everything went fine.

Make sure the test domain is only the text, not the actual link:

sandbox837048be26XXXXd6b68XXXXfa1f6ef4.mailgun.org

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

The response I got back was:

result: id: \<20180130190453.1.67FEF568E8413D43@sandbox837048be2XXXXcd6b68XXXXfa1f6ef4.mailgun.org\> message: Queued. Thank you.

And the message showed up.

If you still can’t get it to work, we can move over to my support email and I can take a look at your set up.

Hope that helps.

-dev

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!

Hi,

I had an issue one time where the “key-” part didn’t get copied for whatever reason, and it caused me all sorts of grief. Glad you got it figured out!

-dev

Hi,

Have you tried using the Mailgun sandbox domain as a test?

-dev

Yes, I get the same result. Spent quite a while on every credential and end point permutation I could think of :slight_smile:

Hi,

I’ll take a look, had passed tests the other day.

-dev

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.

Hi,

I just ran a test and everything went fine.

Make sure the test domain is only the text, not the actual link:

sandbox837048be26XXXXd6b68XXXXfa1f6ef4.mailgun.org

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

The response I got back was:

result: id: \<20180130190453.1.67FEF568E8413D43@sandbox837048be2XXXXcd6b68XXXXfa1f6ef4.mailgun.org\> message: Queued. Thank you.

And the message showed up.

If you still can’t get it to work, we can move over to my support email and I can take a look at your set up.

Hope that helps.

-dev

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!

Hi,

I had an issue one time where the “key-” part didn’t get copied for whatever reason, and it caused me all sorts of grief. Glad you got it figured out!

-dev