Connecting your HTML form

Contact form for GitHub Pages

GitHub Pages only serves finished files and runs no code on the server. A form, however, needs something to receive it. FormPost does that and sends you the input by email.

Before you start: create a form in FormPost

Sign up for FormPost, create a form and enter the domain your site runs on. We then show you your form's address. It replaces https://www.formpost.eu/f/abc123 in the code below – nothing else needs to change.

Add the form to your site

The code below is a complete contact page. Add it to your repository as its own file, or copy just the form block into an existing page. If you build your site with Jekyll, an include is more convenient – see the Jekyll guide.

contact.html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Contact</title>
</head>
<body>
  <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>
</body>
</html>

Good to know

  • In FormPost, enter the domain your site runs on, for example username.github.io.
  • Project sites under username.github.io/project also have the domain username.github.io. The path doesn't matter for the check.
  • If you connect your own domain later, change it in your FormPost form as well. Otherwise we reject submissions from the moment you switch.

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.