FormDrop › Guides › Svelte & SvelteKit contact form without a backend

Svelte & SvelteKit contact form without a backend

Svelte forms can post via fetch with a few lines.

Contact.svelte

<script>
  let status = "idle";
  async function submit(e) {
    status = "sending";
    const body = Object.fromEntries(new FormData(e.currentTarget));
    const res = await fetch("https://forms.elimbi.com/submit", {
      method: "POST",
      headers: { "Content-Type": "application/json", Accept: "application/json" },
      body: JSON.stringify({ ...body, access_key: "YOUR-ACCESS-KEY" }),
    });
    status = (await res.json()).success ? "sent" : "error";
  }
</script>
{#if status === "sent"}<p>Thanks!</p>{:else}
<form on:submit|preventDefault={submit}>
  <input name="name" required />
  <input name="email" type="email" required />
  <textarea name="message" required></textarea>
  <input type="checkbox" name="botcheck" style="display:none" />
  <button disabled={status === "sending"}>Send</button>
</form>{/if}

Works with adapter-static because nothing runs on your server.

Supported fields

Every other field is included in the email and saved in your dashboard log. Send Accept: application/json to get a JSON reply instead of a redirect.

Test it

  1. Create a free access key with your email.
  2. Paste the key, deploy, submit a test message.
  3. Check your inbox and the dashboard log. If mail is delayed, the submission is still stored in the log.

Point your form at one URL and get every message by email. Free for 250 submissions a month.

Get a free access key

FAQ

Is it free?

Yes: 250 submissions/month and unlimited forms on the free plan. Pro is $9/mo for 10,000/month.

Can I upload files?

Not currently — FormDrop handles text fields. Link to a file share instead.

Does it work with JavaScript disabled?

The plain HTML form version does; the fetch version needs JS.

Related guides

Webflow, Framer & no-code builders contact form without a backendHow to send an HTML form to emailContact forms for static sitesStop contact form spam with a honeypot