I have a small Chrome extension that I use just for myself. Currently it uses Mandrill, but Mandrill is going to stop being free in about a month and I am looking for other ways to send emails from the extension.
What I need is something really simple, and pure Javascript-jQuery. I don't mind exposing an API key in the code since the extension is just for my own use. I've been looking at documentation in sites like Mailgun or SparkPost, but I can't find a simple and pure JavaScript example. For instance, this is the code I tried for Mailgun; it's raising a 404 even though I'm using my sandbox URL and it is active:
$.ajax({
type: "POST",
url: "MY SANDBOX URL",
data: {
'user':'api',
'key': 'MY KEY',
'from': 'SENDER EMAIL ADDRESS',
'to': 'RECIPIENT EMAIL ADDRESS',
'subject': 'Subject',
'text': 'Body'
}
}).done(function(response) {
console.log("Email sent");
});
Please, could you help me? Thanks!