是否可以仅通过客户端发送电子邮件?

编程入门 行业动态 更新时间:2024-10-23 11:25:48
本文介绍了是否可以仅通过客户端发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要在使用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"});

更多推荐

是否可以仅通过客户端发送电子邮件?

本文发布于:2023-11-16 04:33:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1601023.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   发送电子邮件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!