How can I send emails without a server? Only front-end Javascript with sendgrid or

Recently, it has become interesting to me how I can send emails only with an interface, such as Javascript via email, as applications for services such as sendgrid or mandrill or so on.

Sendgrid and mandrill have Curl APIS, so basically I can just send an AJAX request to my API to send mail, but the fact is that I have to put the API secret key in a JS file, which means it will be public ... while he must be secret.

These two applications do not say anything in the documents regarding front-panel use, except that you have your own server that will use the API, but I'm currently in an interface-based project. There is no server programming, the server only displays all the assets.

Do you guys know any method or application of this kind to achieve this? Thanks

+6
source share
4 answers

Several suugestions

+4
source

You can use FormSpree. Just provide the URL in the form action.

https://formspree.io/

+3
source

If you want to keep the security key, you can use something like Aerobatic HTTP Proxy to specify the key and proxy through the server environment.

0
source

An alternative is to use each user’s own outgoing mail server using the mailto: link, which allows you to specify header information, as well as a quasi-header with the name "body", which puts the content you want in the message body.

0
source

All Articles