我需要在使用Vue.js的前端应用程序中发送电子邮件,我想知道是否可以仅使用Javascript ..发送邮件,还是为此需要服务器端语言?谢谢!
最佳答案
可能但不实际。您可以使用smtpjs.com。
设置所有信息后,将它们添加到html中:
HTML->头:
<script src="https://smtpjs.com/v2/smtp.js"></script>
JS
Email.send("from@you.com",
"to@them.com",
"This is a subject",
"this is the body",
"smtp.yourisp.com",
"username",
"password");
如果您不想通过http发送凭据,也可以使用一种加密方法。
您可以加密SMTP凭据,并将其锁定到单个域,然后传递安全令牌而不是凭据,例如:
Email.send("from@you.com",
"to@them.com",
"This is a subject",
"this is the body",
{token: "63cb3a19-2684-44fa-b76f-debf422d8b00"});