I want to send a email via form whenever user clicks submit
and for that i use smtpjs
package you can check the site in here https://smtpjs.com/
in pure js we must add this line of code in html head tag
<script src=
"https://smtpjs.com/v3/smtp.js">
</script>
and then we can use Email.send({})
to send the email
but for react
i tried to add the mentioned code(script tag) in head in index.html
and tried to use it as Email.send({})
and window.Email.send({})
and it didn't recognize Email
so my question is how can use the library in react since i added it in index.html
EDIT:
i got this error when sending email 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
i enabled less secure app for google and also turned off 2-step verification but it doesn't help