1

I want to create a section of my portfolio website where people can contact me. It's designed to look similar to an email. I don't want to just include a link, but a whole form so they don't need to open a new window to send me an email. They can enter their name, email address, topic, and content then hit a send button.

The design is based off this website: email form from The Craftsmen The Craftsmen

I'm using Nextjs for this project and I image the code will look something like this:

     <section id='contact'>
        <div >
          <form action="" >
            <div>
              <div >
                <input type="text" placeholder="Name"/>
                <input type="email" placeholder='E-mail'/>
                <input type="text" placeholder='Subject'/>
                <input type="text" placeholder='Message'/>
              </div>
              <div >
                <button type="submit">Send</button>
              </div>
            </div>
          </form>
        </div>
      </section>

Is there any way to make these input values into an email that is sent automatically to me? No need to open their email in browser.

JacoCoder
  • 11
  • 2

1 Answers1

0

You would need to have a page on your web server that would accept this submission and then process the information. Sending the email from the backend.

The only way to do it client side is to have a mailto: link and this would open the clients email client in a new window.

I mean you could potentially try sending through Gmail on the client side, but you may end up in a place where your username and password, to login to Gmail and send, are served with your JavaScript code. Then you have an issue larger than not being able to send email from the client side.

Jacques Ramsden
  • 801
  • 5
  • 20