Formcask

← Guides

Add a contact form to a static site

Point a plain HTML form at a Formcask endpoint. No PHP, no serverless function of your own.

Static sites cannot run a mail script. Formcask is the POST target: the browser sends the form to us, we store it, and we email you.

  1. Create a free account and a form. Copy the endpoint, which looks like https://formcask.com/f/f_….
  2. Paste this markup, replacing the form id:
<form action="https://formcask.com/f/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" required></textarea></label>
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
    <input type="hidden" name="_redirect" value="https://yoursite.com/thanks">
  <button type="submit">Send</button>
</form>

_redirect is optional and must be a full http or https URL. You can also set a default redirect on the form in the dashboard.

Submissions appear in the dashboard and, on Free, arrive by email. Upgrade to Pro for signed webhooks and file uploads. File uploads need enctype="multipart/form-data" and a <input type="file" name="…">.

This works with GitHub Pages, Netlify, Vercel, any CDN, and local HTML files (CORS is open for POST). For a JavaScript success state, POST JSON with Accept: application/json and read {"ok":true}.

const res = await fetch("https://formcask.com/f/f_YOUR_FORM_ID", {
  method: "POST",
  headers: { "content-type": "application/json", accept: "application/json" },
  body: JSON.stringify({ name, email, message }),
});
const data = await res.json(); // { ok: true } on success

Related: Hugo · Jekyll · Astro · Eleventy · GitHub Pages · Vercel · Netlify