我最近想知道如何通过电子邮件即服务应用程序(如 sendgrid 或 mandrill 等)仅使用 Javascript 等前端语言发送电子邮件.
i was wondering lately how i could send emails with only a front-end language like Javascript through Email as a Service apps like sendgrid or mandrill or so.
Sendgrid 和 mandrill 有 Curl APIS,所以基本上我可以向他们的 API 发出 AJAX 发布请求以发送邮件,但问题是,我必须将我的 API 密钥放在 JS 文件中,这意味着它将公开......虽然它应该是秘密的.
Sendgrid and mandrill have Curl APIS, so basically i can just do an AJAX post request to their API to send a mail but the thing is, i will have to put my API secret key in the JS file, this means it will be public... while it's supposed to be secret.
在这两个应用程序上,文档中没有关于前端使用的任何内容,除了拥有将使用 API 的自己的服务器,但我目前在基于前端的项目中.无需服务器编程,服务器仅渲染资产即可.
On those two apps, there's nothing in the docs concerning front-end use except having your own server which will use the API, but i'm currently on front-end based project. No server programming, the server only renders the assets that's all.
你们知道实现这一目标的任何方法或应用程序吗?谢谢
Do you guys know any method or apps of this kind to acheive this ? Thanks
你可以使用FormSpree.只需在表单操作中提供 url.
You can use FormSpree. Just provide the url in form action.
https://formspree.io/
这篇关于如何在没有服务器的情况下发送电子邮件?只有带有 sendgrid 的前端 Javascript 或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!