A contact form for a static site
A site on GitHub Pages, Netlify, Cloudflare Pages or a plain web host serves files only. A form needs something that can receive the post and send a mail. Your options:
1. A mailto: link
Simple and free, but it opens the visitor's own mail program. Many visitors have none set up, and you get no spam protection or record.
2. Your own small server or function
Full control, but you must keep it running, send mail reliably (SPF, DKIM, a provider), and defend it against spam and abuse. Worth it at scale.
3. A form backend
You point the form at a hosted endpoint with a key; they validate and email it. This is what Zexa Forms is, alongside Formspree, Forminit (Getform) and Web3Forms.
What to look for
- Spam protection: a honeypot field at least, rate limits, optional captcha.
- Where mail goes: only to a verified address of yours, not anywhere the form says.
- Domain restriction for your key.
- How long they keep messages, and whether you can delete them.
- The free limit and what happens when you pass it.
Minimal example with Zexa Forms
<form action="https://forms.zexa.se/submit" method="POST">
<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
<input type="hidden" name="form_name" value="Contact form">
<input type="text" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
<input type="text" name="name" required>
<input type="email" name="email" required>
<textarea name="message" required></textarea>
<button type="submit">Send</button>
</form>Try it: enter your email and get a key, or read the docs.