The static site challenge
Static sites โ built with plain HTML, Jekyll, Hugo, Eleventy, Astro, or exported from a framework โ can't run server-side code. There's nothing to receive a form POST and send an email. You need a service that bridges that gap.
The good news: you have plenty of options. The bad news: some of them are surprisingly bad. Let's cut through the noise.
6 options compared
Detailed comparison
| Option | No server code? | Custom styling? | Spam protection? | Free tier? |
|---|---|---|---|---|
| Form backend (e.g. SubmitraX) | โ Yes | โ Full control | โ Built-in | โ Yes |
| Netlify Forms | โ Yes | โ Full control | โ Basic | โ ๏ธ 100 subs/mo |
| EmailJS | โ Yes (JS only) | โ Full control | โ None | โ ๏ธ 200 subs/mo |
| Serverless function | โ Needs code | โ Full control | โ DIY | โ Usually |
| Google Forms | โ Yes | โ No | โ Google's | โ Free |
| mailto: action | โ Yes | โ Full control | โ None | โ Free |
Recommendation by stack
Netlify
Use Netlify Forms if you're on their free hobby tier and expect fewer than 100 submissions/month. Add netlify to your form tag โ that's it. For anything beyond that, a form backend service gives you more submissions and better analytics.
Vercel
Vercel doesn't offer a native form backend. Your options: write a Vercel API route (serverless function), or use a form backend service. The latter is far faster to ship.
GitHub Pages
No backend, no functions, pure static hosting. A form backend service is your only good option here. EmailJS also works but requires you to expose a service ID in your client-side JavaScript.
Astro / Hugo / Jekyll / Eleventy
Framework-generated static output. Same situation as GitHub Pages โ you need an external form backend. Any of these generators produce clean HTML that works perfectly with a method="POST" form pointing at a backend endpoint.
Fastest path: use a form backend service
Here's the concept in one sentence: a form backend service gives you a URL. You POST to that URL. They email you the data. Full stop.
- Sign up and get your endpoint URL
Takes about 60 seconds. You'll get something like
https://api.submitrax.com/f/abc123. - Set your form's
actionto that URLAdd
method="POST". Give every input anameattribute โ that becomes the field label in your email. - Style it however you like
The backend doesn't touch your HTML, CSS, or design. Your form looks exactly how you want it.
- Receive submissions in your inbox
Every submission triggers a formatted email to the address attached to your account. You can also view a dashboard of all submissions.
Full code โ copy and paste
Complete, runnable contact form. Replace YOUR_FORM_ID and add your own CSS:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact</title>
</head>
<body>
<form
action="https://api.submitrax.com/f/YOUR_FORM_ID"
method="POST"
>
<label>Name
<input type="text" name="name" required>
</label>
<label>Email
<input type="email" name="email" required>
</label>
<label>Message
<textarea name="message" rows="5"></textarea>
</label>
<!-- Honeypot โ hides from humans, traps bots -->
<input type="text" name="_gotcha" style="display:none">
<!-- Optional: custom thank-you page -->
<input type="hidden" name="_redirect"
value="https://yoursite.com/thanks">
<button type="submit">Send message</button>
</form>
</body>
</html>๐ Try it live
Add a contact form to your static site in 60 seconds
SubmitraX gives you a form endpoint that works on any static site โ GitHub Pages, Netlify, Vercel, Astro, Hugo, plain HTML. No servers, no code, no fuss.
Get your free endpoint โ