我需要在使用Vue.js的前端应用程序中发送电子邮件,我想知道是否可以仅使用Javascript发送邮件。还是为此需要服务器端语言?谢谢!
I need to send emails in a front-end application that I'm using Vue.js, I would like to know if it's possible to send mail only with Javascript .. or do I need a server-side language for this? Thank you!
推荐答案可能,但不实际。您可以使用smtpjs。 设置所有信息后,将它们添加到html中:
It is possible but not practical. You can use smtpjs. After you setup all the information, add these to your html:
HTML-> Head:
HTML -> Head:
<script src="smtpjs/v2/smtp.js"></script>JS
Email.send("from@you", "to@them", "This is a subject", "this is the body", "smtp.yourisp", "username", "password");如果您不想通过http发送凭据,也可以通过以下方式对其进行加密:
If you don't want to send your credentials over http, there's also a way to encrypt it as well.
您可以加密SMTP凭据,并将其锁定到单个域,然后传递安全令牌代替凭据,例如:
You can encrypt your SMTP credentials, and lock it to a single domain, and pass a secure token instead of the credentials instead, for example:
Email.send("from@you", "to@them", "This is a subject", "this is the body", {token: "63cb3a19-2684-44fa-b76f-debf422d8b00"});更多推荐
是否可以仅通过客户端发送电子邮件?
发布评论