I am trying to use an API for sending emails with JavaScript, it's called SmptJs. The API works perfectly when integrated in a simple HTML file, but I don't know how to integrate it in a reactJs component!
Here is the API link and doc: https://smtpjs.com/
I tried it first in my HTML page, like this: code of html file
And it worked, I received the email. But I want to add the API inside my React Component, specifically when I click submit in my form but I got an error and I think it's not compatible with ReactJs syntax, here is the image:

