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