How to send email with Mailgun

Hi,
I'm trying out the "send email with Mailgun" plugin but I can't make it work.

I already set up an account with Mailgun and was following the instructions written by Max (appery.io) for Mailgun, which appear to be outdated.

I found this topic (https://getsatisfaction.com/apperyio/...) in which Max says not to use a proxy anymore but to use the code below on a Server Code script. I used the code but it's not working for me.

1. Is the code still the one we should use?
2. In the url, can I use my domain as "mg.mydomain.com" if I have set it up on Mailgun?
3. Do I need the API key specific to my domain or a general "user" API key?

CODE FROM MAX:
var url = "https://api.mailgun.net/v3/your_domai...";
var XHRResponse = XHR2.send("POST", url, {
"parameters": {
"from":"Excited User ",
"to":"user@email.com",
"subject": "Email subject",
"text": "Hello from Appery.io"
},
"headers": {
"Authorization": "Basic base64string (api:abc...)"
}
});
Apperyio.response.success(XHRResponse.body, "application/json");

Thanks,
Rodrigo
1 person has
this question
+1
Reply