FormRill
  1. Docs
  2. Quick starts

Send email from an HTML form without a server

Browsers can’t send email on their own, and mailto: links only open the visitor’s mail app, if they have one. Something has to receive the POST. FormRill does that, with no PHP or server to run.

1. Get your form URL

Enter your email at signup. Your dashboard opens on your first form, and it is already wired to email every submission to you. Copy the Form URL from the Setup tab; it looks like https://api.formrill.com/f_…/submit.

Signing back in. Signup emails you a private sign-in link. If you lose it, request a new one from the login page; requesting a new link signs out your other devices.

2. Paste this form

<form method="POST"
  action="https://api.formrill.com/YOUR_FORM_ID/submit">
  <input type="checkbox" name="botcheck" hidden />
  <input type="text" name="name" required />
  <input type="email" name="email" required />
  <textarea name="message" required></textarea>
  <button type="submit">Send</button>
</form>
const form = document.querySelector('form')

form.addEventListener('submit', async (event) => {
  event.preventDefault()
  const res = await fetch(form.action, {
    method: 'POST',
    body: new FormData(form),
    headers: { Accept: 'application/json' },
  })
  const result = await res.json()
  if (result.ok) form.reset()
  else alert(result.error)
})
curl -X POST https://api.formrill.com/YOUR_FORM_ID/submit \
  -H 'Accept: application/json' \
  -d 'name=Test' -d 'email=you@example.com' -d 'message=Hello'

# {"ok":true,"id":"s_..."}

Replace YOUR_FORM_ID with your ID, or paste the ready-made snippet from the Setup tab. Every field with a name is included in the email. Name the email field email so that hitting Reply on the notification writes straight back to the visitor.

The hidden botcheck checkbox is a honeypot: bots tick it, people never see it, and those submissions go to the Spam folder in your dashboard instead of your inbox.

File uploads aren’t supported yet. A form that sends a file (<input type="file">) gets a clear error and nothing is saved. Leave file inputs out until file uploads ship. Details

3. Optional: your own thank-you page

<input type="hidden" name="redirect" value="https://example.com/thanks" />

Use a full URL, starting with https://; a relative path is ignored. You can also set a default in the form’s settings instead.

Submitting with JavaScript

Send Accept: application/json and you get JSON back instead of a page. The fetch tab above has the full handler.

Nothing arriving? Work through the troubleshooting checklist.

Every response shape and status code is in the API reference.

Get the form URL for this guide

Free up to 500 submissions a month and unlimited forms. No server, no credit card.

Start free

Related

Last updated