โšก Compared & Tested

Best Way to Add a Contact Form
to a Static Website

Every option explained โ€” Netlify Forms, EmailJS, form backends, serverless functions, and more. Pick what fits your stack and your budget in under 10 minutes.

๐Ÿ“– 10 min read๐Ÿ” 6 approaches compared๐Ÿ† Clear winner for each case

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.

โœ…
The short answer For most static sites, the fastest reliable path is a form backend service. It works with zero server code, takes minutes to set up, and handles spam, storage, and email delivery for you.

6 options compared

Recommended
โšก

Form backend service

Point your form's action at an endpoint URL. Get emails instantly.

Best for most sites
๐Ÿ”ท

Netlify Forms

Built-in if you deploy on Netlify. Requires a netlify attribute. Limited free tier.

Best if you're on Netlify
๐Ÿ“ง

EmailJS

Calls email API from your JavaScript. Exposes API keys in client code.

OK with caveats
โš™๏ธ

Serverless function

Write a cloud function (AWS Lambda, Vercel Edge) to handle submissions.

Good for custom logic
๐Ÿ”—

Google Forms embed

Embed a Google Form iframe. No custom styling. Looks foreign on your site.

Poor UX
๐Ÿ“ฎ

mailto: action

Opens the visitor's mail client. Broken on most devices. Not suitable for real use.

Skip entirely

Detailed comparison

OptionNo 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.

  1. Sign up and get your endpoint URL

    Takes about 60 seconds. You'll get something like https://api.submitrax.com/f/abc123.

  2. Set your form's action to that URL

    Add method="POST". Give every input a name attribute โ€” that becomes the field label in your email.

  3. Style it however you like

    The backend doesn't touch your HTML, CSS, or design. Your form looks exactly how you want it.

  4. 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:

HTML
<!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

Powered by SubmitraX. Set up yours in 60 seconds.

๐Ÿš€ Easiest path to a working form

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 โ†’
โœ“ Free plan availableโœ“ Works everywhereโœ“ Spam filtering included