Skip to content
FormToMail

HTML form to email

Simple contact form HTML template (free, accessible, works)

By the FormToMail team · Checked against official sources · Updated

Below is a free, accessible contact form template: real <label>s, required and type="email" validation, a hidden honeypot and a working action. Paste your own endpoint URL into action and it emails you every submission.

What makes a contact form accessible
ElementWhy
<label> for every fieldScreen readers announce what to type
required, type="email"Browser shows clear errors before sending
autocomplete attributesFaster filling on phones
Visible focus stylesKeyboard users see where they are

Template

html
<form class="contact" action="https://getformtomail.com/f/YOUR_FORM_ID" method="POST">
  <label for="cf-name">Name</label>
  <input id="cf-name" name="name" autocomplete="name" required>

  <label for="cf-email">Email</label>
  <input id="cf-email" name="email" type="email" autocomplete="email" required>

  <label for="cf-msg">Message</label>
  <textarea id="cf-msg" name="message" rows="5" required></textarea>

  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send message</button>
</form>
<style>
  .contact { display:grid; gap:.5rem; max-width:32rem; font:16px/1.5 system-ui, sans-serif }
  .contact input, .contact textarea { padding:.65rem .8rem; border:1px solid #c9ccd1; border-radius:10px; font:inherit }
  .contact input:focus, .contact textarea:focus { outline:2px solid #ff8a3d; outline-offset:1px }
  .contact button { margin-top:.5rem; padding:.75rem 1rem; border:0; border-radius:999px; background:#111; color:#fff; font-weight:600 }
</style>

Tailwind version

Use the same markup with classes such as grid gap-2 max-w-lg, rounded-lg border px-3 py-2 on inputs and rounded-full bg-black text-white px-4 py-3 on the button.

Quick answers

Accessible contact form HTML example?

The template above uses labels, native validation and autocomplete.

How do I add required fields and error messages to an HTML form?

Add required and the right type; browsers show their own messages. For custom text, use setCustomValidity().

How do I add a consent checkbox to my contact form?

Add <input type="checkbox" name="consent" value="yes" required> with a label linking to your privacy policy; the value is included in the email.

How do I style a contact form with Tailwind?

Keep the markup and add Tailwind classes; the endpoint only cares about field names.

What to do next

Get an endpoint for the template's action URL.

Get your form endpoint

Sources

Checked: . Prices, limits and features of other services change: confirm current values at the official links above. Product names belong to their owners; we are not affiliated with them.