每当用户单击提交时,我想通过表单发送电子邮件
为此我使用smtpjs包,您可以在此处查看站点https://smtpjs.com/
在纯js中我们必须在html头标签中添加这行代码
<script src=
"https://smtpjs.com/v3/smtp.js">
</script>
然后我们可以Email.send({})用来发送电子邮件
但为了反应
我试图在头中添加提到的代码(脚本标签)index.html
并尝试将其用作Email.send({})并且window.Email.send({})
它没有识别Email
所以我的问题是如何在反应中使用库,因为我在 index.html 中添加了它
编辑:
我在发送电子邮件时收到此错误 The SMTP server requires a secure connection or the client was not
authenticated. The server response was: 5.7.0 Authentication Required. Learn
more at - Fix: Try a different SMTP server :
https://elasticemail.com/account#/create-account?r=20b444a2-b3af-4eb8-bae7-
911f6097521c
我为谷歌启用了不太安全的应用程序,还关闭了两步验证,但它没有帮助