Send an HTML form to email without running a server
People try `mailto:`, then a PHP script, then Google Apps Script, and each has a catch. Below is the honest comparison, then the approach that actually works on any host, including static ones, followed by a complete, accessible example you can paste today.
HTML alone cannot send email. A form needs a server to receive the POST and hand it to a mail service. The simplest way without running one is a form endpoint: set your form’s action to a URL that accepts the submission, filters spam, and emails it to you. That’s a three-line change, no backend.
The minimal integration
This is the whole thing: a normal HTML form whose action points at your endpoint. No JavaScript required. The browser posts it and lands on a success page.
<form action="https://mtform.co/f/your-form-key" method="POST">
<label>
Name
<input name="name" autocomplete="name" required>
</label>
<label>
Email
<input type="email" name="email" autocomplete="email" required>
</label>
<label>
Message
<textarea name="message" required></textarea>
</label>
<!-- Spam trap: hidden from people, tempting to bots. Leave it empty. -->
<input
type="text"
name="_mtf_honeypot"
tabindex="-1"
autocomplete="off"
aria-hidden="true"
style="position:absolute;left:-9999px"
>
<button type="submit">Send</button>
</form>Replace your existing <form> tag, or just change its action attribute. The browser navigates to a branded success page. Configure a redirect in Settings.
Step by step
- 01
Create a form endpoint
Sign up and create a form. You get a public endpoint URL (safe to put in client code) and a searchable inbox: no server to deploy.
- 02
Point your form’s action at it
Change your <form> tag’s action attribute to the endpoint and set method="POST". Keep your existing fields and markup.
- 03
Verify your email once
Click the verification link so notifications can be delivered. Submissions received before verification are still stored, never dropped.
- 04
Submit and confirm
Fill in the form. The submission arrives in your inbox and by email, with the sender in Reply-To so you can respond directly.
The one-liner everyone tries first. It doesn’t send anything. It opens the visitor’s email client with a blank draft, loses the data if they don’t have one configured, and exposes your address to scrapers.
<!-- Looks like it emails you. It does not. -->
<form action="mailto:you@example.com" method="POST" enctype="text/plain">
<input name="email" type="email">
<textarea name="message"></textarea>
<button>Send</button>
</form>Common pitfalls
Using mailto: in production
`mailto:` depends on the visitor having a configured desktop mail client, sends nothing on most phones, and publishes your address for spam harvesters. It’s a demo, not a contact form.
Spoofing the sender in From
Never set the notification’s From to the submitter’s address. It fails SPF/DKIM and lands in spam. Put the submitter in Reply-To (a good endpoint does this for you) and send from an authenticated address.
Troubleshooting
| Symptom | What is happening | Fix |
|---|---|---|
| mailto: opens a draft | You used action="mailto:", the browser hands off to a mail client instead of sending. | Switch the action to a real endpoint URL that receives the POST server-side. |
| no email arrives | The recipient address hasn’t been verified, or the notification went to spam. | Verify the recipient once; check the inbox (submissions are stored regardless) and your spam folder. |
| goes to spam | The message is failing authentication or the From is spoofed. | Use an endpoint that sends from its own authenticated domain and maps the submitter to Reply-To. |
Frequently asked questions
→Why can’t an HTML form send email directly?
HTML only describes the form and where to POST it. Sending email requires a server that receives the submission and talks to a mail service (SMTP/API). Browsers deliberately can’t send mail, so you need either your own server or a hosted form endpoint that does it for you.
→Is there an HTML tag to send an email from a form?
No. There is no HTML element that sends email. The closest, `action="mailto:"`, just opens the visitor’s email app with a draft. It doesn’t deliver anything and often does nothing on mobile.
→Can I send an HTML form to email without any backend code?
Yes. Point the form’s action at a hosted form endpoint. It receives the POST, filters spam, stores the submission, and emails it to you, so you write no server code and host nothing extra.
→Does this work on a static site like GitHub Pages or Netlify?
Yes. Because the endpoint is external, static hosts that can’t run server code work fine: the form just POSTs to the endpoint’s URL.
Keep going
- Contact form without a backend
- GitHub Pages contact form
- React contact form
- Form backend for AI-built websites
Last reviewed July 23, 2026
Ship this form for real
Create an endpoint, paste it in, and watch the first submission land in your inbox, in under three minutes.
Create free endpoint