Skip to content
FormToMail

Send an HTML form to your email

A browser can't send email by itself. A form needs somewhere to POST to that turns the submission into an email. These guides show the code for plain HTML, JavaScript and React.

How do I make an HTML contact form send to my email?

HTML by itself can't send an email: a form only sends its fields to the URL in its action. To get submissions by email, set action to a form endpoint, use method="POST", and give every input a name; the endpoint turns each submission into an email to you. No PHP or server needed.

How do I send an HTML form to email without PHP?

Without PHP you post the form to a service that sends the email for you: either a hosted form endpoint (paste its URL into action) or your own serverless function that calls an email API. Both work on static hosts like GitHub Pages, Netlify, Vercel or Cloudflare Pages, where PHP doesn't run.

How do I submit a form with fetch() and show a thank-you message without reloading?

Listen for the form's submit event, call e.preventDefault(), send new FormData(form) with fetch() and the header Accept: application/json, then show a thank-you message from the JSON answer. The page never reloads and the visitor stays where they were.

How do I build a React contact form that sends email without a backend?

In React you send the form data to a form endpoint with fetch() in the submit handler and keep the status in state; the endpoint emails you. No backend of your own is needed, so it works in Vite, Next.js static exports and React apps generated by Lovable, Bolt or v0.

Should I use a mailto link instead of a contact form?

A mailto: link is fine for a personal page, but it only opens the visitor's email app: if they use webmail without a default app it does nothing, and your address sits in the HTML where scrapers can harvest it. A contact form works for every visitor, can filter spam, and keeps your address private.

What is a form backend (form endpoint) and how does it work?

A form backend is a hosted URL that receives your form's POST, checks it for spam, emails the fields to you and keeps a copy in a dashboard. You put the URL in the form's action (or call it with fetch()), so a static or AI-built site gets a working form without running any server code.

How do I redirect to my own thank-you page after a form submits?

Add a hidden field <input type="hidden" name="_next" value="https://yoursite.com/thanks"> to the form, or set a default thank-you URL in your FormToMail dashboard; after each submission the visitor is sent there instead of the generic page. With fetch(), there's no redirect at all: you show your own message in the page.

Can form submissions go to Slack, Discord or a webhook instead of email?

Yes. With FormToMail Pro you paste a Slack or Discord incoming-webhook URL, or any https webhook, into the form's settings, and every non-spam submission is posted there as well as emailed. Your own webhook receives JSON signed with an HMAC-SHA256 header so you can check it came from us; from there Zapier, Make or your code can send it on to Google Sheets or a CRM.

Simple contact form HTML template (free, accessible, works)

Below is a free, accessible contact form template: real <label>s, required and type="email" validation, a hidden honeypot and a working action. Paste your own endpoint URL into action and it emails you every submission.

Make your form email you

Paste one URL into your form and every submission is emailed to you, spam filtered. Free for 250 a month.

Get your endpoint