I need information from a form that someone filled out to be sent to my email when a button is clicked, using JS only, without PHP. My code:
<form action="form.js" method="post">
<label for="name">Name</label><br>
<input type="text" name="name" id="name" placeholder="Your name"><br>
<label for="email">Email</label><br>
<input type="email" name="email" id="email" placeholder="Your email"><br>
<label for="password">Password</label><br>
<input type="password" name="password" id="password" placeholder="Your password"><br>
<label for="feedback">Feedback</label><br>
<textarea name="feedback" id="" cols="30" rows="10" placeholder="Your feedback"></textarea><br>
<button type="submit">Send</button>
</form>
<script src="./form.js"></script>
I try do it on php but my mentor say that I should do it only Js
Please help me how to do this <3
To send information from a form to your email using JavaScript only (without server-side scripting like PHP), you can use a service like EmailJS. Example:
JavaScript: