Connecting your HTML form

Send an HTML form to email

A form whose contents arrive in your inbox sounds like one line of HTML. The obvious route via mailto, however, doesn't work for many visitors. Here's why, and how to do it reliably.

The obvious route: mailto

With action="mailto:…", the browser opens the visitor's email program on submit instead of sending the data itself.

That has drawbacks. If no email program is set up – on many work computers, on phones and for people who only use webmail – nothing happens or an empty window opens. Depending on the browser, the input is not carried over or only partly, and the visitor still has to send the message themselves. Your address is also visible in the source code, where spam harvesters find it.

contact.html
<form action="mailto:info@example.com" method="POST" enctype="text/plain">
  <label for="message">Message</label>
  <textarea id="message" name="message"></textarea>

  <button type="submit">Send</button>
</form>

The reliable route: a form service

If the action attribute points to FormPost, the browser sends the data to us. We send the email, and your visitor sees a confirmation page. They don't need an email program, and your address doesn't appear in the source code.

You get the address when you create a form in FormPost. It replaces https://www.formpost.eu/f/abc123 in the code below.

contact.html
<form action="https://www.formpost.eu/f/abc123" method="POST">
  <label for="email">Email</label>
  <input type="email" id="email" name="email" required>

  <label for="message">Message</label>
  <textarea id="message" name="message" required></textarea>

  <input type="text" name="_gotcha" style="display:none;" tabindex="-1" autocomplete="off">

  <button type="submit">Send</button>
</form>

Good to know

  • Every form is locked to your domain. We reject submissions from other sites so nobody can copy your form address and abuse it.
  • If a field is named email, we use that address as the reply-to – you can answer straight from your inbox. For encrypted submissions the notification contains no content and therefore no reply-to address.
  • On the free plan we send up to ten notifications a day. Anything beyond that isn't lost; it's waiting in your dashboard.

What FormPost cannot do today

  • Forms are submitted the classic way, meaning the page changes. Sending in the background via JavaScript is not supported at present.
  • We do not accept file attachments.
  • FormPost does not collect consent from your visitors. The notice in your own privacy policy remains your job – the wording for it is waiting, ready to copy, next to your form.

More guides and comparisons

Create a form and try it

The Free plan covers one form with ten notifications a day and costs nothing, permanently.