0

It would be awesome if I could just send emails via mailjet from the frontend without the need of a backend.

The only implementations on their page are for backend systems. But shouldn`t it in theory be possible to use mailjet without a backend? Sending emails through mailjet should be nothing more than just some post request, don't they? If so, why is there no JS implementation?

Yves
  • 1,152
  • 1
  • 23
  • 30
  • 1
    You can, using [EmailJS.com](http://www.emailjs.com) - it keeps your keys private while allowing you to send pre-built email templates directly from Javascript (disclosure - I'm one of the creators). – Sasha Jan 22 '17 at 13:13
  • Haha... "Send email directly from Javascript" it seems a little like a parody because that could have been my title. Thanks @Sasha that would solve my problem but in my case I just want to send an email from a contact-form. So the use-case is to small to pay an extra service for it. I'll keep EmialJS in mind for future projects though. – Yves Jan 22 '17 at 18:00
  • note that we have a free tier which should be enough for a personal site, but also feel free to reach out to me at (my name at emailjs.com) if you need to bump up the quota. Good luck, anyway :) – Sasha Jan 23 '17 at 09:53
  • I saw the free plan but there will be a footer attached and that's unfortunately unacceptable for my current project. But thanks anyway @Sasha – Yves Jan 25 '17 at 10:53

2 Answers2

5

Disclaimer: Mailjet's employee here.

As long as you don't expose your credentials to the public, you can call the Mailjet's APIs using HTTP. The tool's choice is up to you: cURL, Postman or Paw, one of our language wrappers, or directly any HTTP call such as XMLHttpRequest for your JavaScript front-end.

You will find many examples in our documentation.

To learn more about credentials security, I advise you this nice W3C webappsec credential management ebook.

hAPI coding!

grebett
  • 467
  • 4
  • 10
  • Looks like it could work only in chrome : http://caniuse.com/#search=credential but do you have any example ? – jujule Apr 30 '17 at 22:51
1

You can but where do you plan to keep your public and private key?

Tuan Anh Tran
  • 6,807
  • 6
  • 37
  • 54