1

I was just wondering if there was a way to submit and send the data of a form to my email using only pure JavaScript. My form looks like this:

<form onsubmit="return false;" method="post" action="#">
      <div class="form__group">
        <input type="text" class="form__input" placeholder="Name" required>
        <img src="img/user.png" alt="User icon" class="form__input-img">
      </div>
      <div class="form__group">
        <input type="email" class="form__input" placeholder="joe@example.com" required>
        <img src="img/mail.png" alt="User icon" class="form__input-img">
      </div>
      <div class="form__group">
        <textarea class="form__input" name='message' placeholder="Message" rows="8" required></textarea>
        <img src="img/pencil.png" alt="User icon" class="form__input-img">
        <div class="expand">
          <p>Your message was sent successfully!</p>
          <span class="close-btn"><i class="fas fa-times"></i></span>
        </div>
      </div>
      <div class="form__group">
        <input id="submit" type="submit" class="form__submit btn" value="Send message">
      </div>
    </form>

If you wish to see a live version, please visit www.gilbertrosario.com, at the end of the webpage you will see the form and the type of data I'd like to send to my email. Any help is greatly appreciated.

Gilbert R.
  • 282
  • 1
  • 7
  • 19

0 Answers0