splitforms.com
← Back to the journal

How to Send HTML Form Data to Email Without a Server

Send HTML form submissions to your inbox without any server, SMTP setup, or backend code. Full snippet, 2-minute setup, works on any static site.

Start free — 500 submissionsSee pricing →No card, no time limit. Pro is $5 per month.
Short answer
You can't send email from HTML alone: browsers have no SMTP access. To email a form without running your own server, point the form's action at a hosted form backend such as splitforms. The browser posts the fields there; the service saves the submission and emails you a notification. No PHP, no SMTP setup, no JavaScript required.
Try it on your own form

Point any HTML form at one endpoint. 500 free submissions — no card, no time limit — and unlimited forms.

Create free account

Can you send an HTML form to email without a server?

Yes, but only because someone else runs the server. HTML can't send email, and neither can JavaScript in the browser. What you can do is let the browser POST the form to a hosted form backend that does have mail infrastructure. It saves the submission and emails you a notification, while your own site stays completely static.

The setup is one HTML snippet. Replace YOUR_ACCESS_KEY with your real key from splitforms.com/login:

<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
  <!-- Optional: send visitors to your own thank-you page -->
  <input type="hidden" name="redirect" value="https://yoursite.com/thanks" />

  <label>Name <input name="name" required /></label>
  <label>Email <input name="email" type="email" required /></label>
  <label>Message <textarea name="message" required></textarea></label>

  <!-- Honeypot: invisible to humans, filled by bots -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off" />

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

Paste it into Webflow, WordPress, Next.js, Astro, Carrd, GitHub Pages, Cloudflare Pages, anywhere static HTML lives. When a visitor submits, the message appears in your dashboard and the notification email goes out to your inbox. The hidden redirect field works on every plan: point it at a page on your own site (or a path like /thanks) and visitors land there after submitting.

How do the ways to send a form to email compare?

Every way to get form data into an inbox, including the one that doesn't work. "Own server" means a machine or backend code you have to run and maintain.

MethodOwn server?Needs JavaScript?Spam filteringSaved copy of each messageSetup
Hosted form backend (splitforms)NoNoBuilt in: honeypot, rate limits, automatic spam scoringYes, in your dashboardAbout 2 minutes
mailto: link or action="mailto:"NoNoNoneNo, and only sent if the visitor presses Send in their own email app1 minute, but often does nothing
Host's built-in forms (e.g. Netlify Forms)NoNoProvided by the hostYes, in the host's dashboardMinutes, but only while you stay on that host
Serverless function + email API (Vercel, Netlify or Cloudflare functions with Resend, SendGrid, Postmark)No machine to run, but you write and deploy backend codeNoYou build itOnly if you add a databaseHours, plus upkeep
Client-side email SDK (EmailJS-style)No (the provider's server sends it)YesVaries by providerVaries by providerMinutes to an hour
PHP mail() scriptYes, a PHP hostNoYou build itOnly if you add a databaseHours; many hosts restrict mail()
SMTP straight from browser JavaScriptn/an/an/an/aNot possible: browsers can't open SMTP connections

How to choose:

How do you set it up, step by step?

  1. Sign up. Go to splitforms.com/login and continue with Google, or enter your email and paste the 6-digit code from your inbox.
  2. Copy the access key. Your dashboard shows each form's access key, a long random string. It tells splitforms which form a submission belongs to.
  3. Paste the snippet above on your site, replacing YOUR_ACCESS_KEY.
  4. Send a test. Open the page, fill in the form and click Send. The submission shows up in your dashboard, and the notification email follows. If it isn't in your inbox, check spam once and mark it as not spam.

That's the whole flow. No webhooks to configure, no SMTP servers to point at, no environment variables to set.

Once it works, the form to email notification settings cover what you can change: the subject line, the sender name, which inbox receives each message, and, on paid plans, CC/BCC and routing by answer.

Why can't HTML or JavaScript send email on their own?

HTML describes a page for the browser to render. Its only networking ability is "request this URL", which is exactly what a form's action does. It has no way to hand a message to a mail server.

JavaScript in the browser can't either. Browsers only allow web traffic (HTTP requests, WebSockets, WebRTC); they don't let a page open the raw TCP connection that SMTP needs on ports 25, 465 or 587. That restriction is deliberate: if any web page could send mail, every site you visited could send spam from your computer.

Libraries that promise "SMTP from JavaScript" get around this by posting your message to their own server, which then sends it. That is still a server, just one you don't control, and if the library asks for your SMTP username and password, those credentials sit in your page source where any visitor can copy them.

So somewhere in the chain there has to be a server that speaks SMTP. The only real question is whether you run it (a PHP host or a serverless function plus an email API) or let a form backend run it for you. For a contact form, a form backend is the shortest path unless you need full control.

How do you send the form from React, Vue or another JavaScript app?

Same endpoint, slightly different syntax. You call fetch() instead of letting the browser submit, and splitforms answers with JSON:

async function onSubmit(e) {
  e.preventDefault();
  const formData = new FormData(e.target);
  formData.append("access_key", "YOUR_ACCESS_KEY");
  const res = await fetch("https://splitforms.com/api/submit", {
    method: "POST",
    body: formData,
  });
  const data = await res.json();
  if (data.success) showSuccessMessage();
}

Your email provider's credentials never appear in this code; only the public access key does. For the full walkthrough see sending form data to email with JavaScript fetch, or a framework guide:

How do you stop spam without a captcha?

The honeypot field in the snippet above stops a lot of simple bots on its own. Bots tend to fill every input they find; humans never see a display:none input. splitforms silently drops any submission with a filled-in botcheck field, and every plan also applies rate limiting and automatic spam scoring, with suspicious messages held in a Spam folder instead of your inbox.

If a form still attracts spam, add Cloudflare Turnstile or Google reCAPTCHA; both can be turned on per form. See honeypot vs reCAPTCHA and how to stop contact form spam.

Why not just use a mailto: link?

A mailto: link, or a form with action="mailto:you@example.com", asks the browser to open the visitor's default email app with a pre-filled draft. Plenty of visitors don't have one set up, especially on shared or work computers where mail lives in a browser tab, so clicking often does nothing visible. Even when a draft opens, the visitor still has to press Send, and you never learn about the ones who don't.

There's also no saved copy and no spam filtering, and your address sits in the page source for scrapers. Keep mailto: as a secondary "or email us" link next to a real form, not as the form itself.

Can you accept file uploads without a server?

Yes. Add enctype="multipart/form-data" to the form and an <input type="file">. File uploads are a paid feature on splitforms (Pro at $5/month or Annual at $49/year): turn on Storage under your dashboard's integrations, and each submission can carry up to 5 files of 5 MB each. See how to add file uploads to a contact form.

Frequently asked questions

Can I send an HTML form to email without a server?

Yes, as long as someone else runs the server. Set the form's action to a hosted form backend such as splitforms and add your access key as a hidden field. The browser posts the submission to that service, which saves it and emails you a notification. Your own site stays fully static.

Can I send an HTML form to email without PHP?

Yes. PHP's mail() function only matters if you run your own PHP server. A hosted form backend replaces the PHP script entirely: the form posts to the backend's endpoint instead of a contact.php file, so it works on static hosts like GitHub Pages, Netlify or Cloudflare Pages where PHP isn't available.

Can JavaScript send an email by itself?

No. Browser JavaScript can't open an SMTP connection, so it can't talk to a mail server directly. Libraries that appear to send mail from the browser relay the message through a third-party server, and any SMTP username or password placed in client-side code is readable by every visitor. Post the form to a form backend or your own serverless function instead.

Why not just use a mailto: link?

A mailto: link, or a form whose action is a mailto: address, only opens the visitor's email app with a pre-filled draft. If they have no email app set up, nothing useful happens, and even when it works they still have to press Send themselves. You get no saved copy of the message and no spam filtering.

Does it work without JavaScript?

Yes. A plain HTML form with method POST and an action URL is submitted by the browser itself, even with JavaScript turned off. After splitforms accepts the submission, it sends the visitor to the page in your hidden redirect field (for example your own thank-you page), or shows a standard success page if you didn't add one.

Can I send form submissions to Gmail without a backend?

Yes. Set your Gmail address as the form's notification email in splitforms and each accepted submission is emailed there. Nothing has to be configured inside Gmail: no SMTP settings and no app passwords. If the first notification lands in spam, mark it as not spam so later ones reach your inbox.

How many submissions can I receive for free?

The splitforms free plan includes 500 submissions with no card and no time limit, plus unlimited forms and email notifications. The allowance is a total, not monthly. If you need a monthly allowance, Pro costs $5/month for 5,000 submissions a month and includes every paid feature; Annual is $49/year for 15,000 a month.

Will the notification emails go to spam?

splitforms saves every accepted submission to your dashboard first, then sends the owner notification email. Inbox placement depends on the sending provider and the recipient's filters, so check the dashboard if an email doesn't arrive. On paid plans you can send notifications through your own SMTP provider and domain.

What if I want to send through my own email provider (Resend, SendGrid, Postmark)?

You have two routes. You can write a serverless function that validates the form, filters spam, stores the submission and calls your provider's API, which takes hours plus ongoing upkeep. Or you can keep the form backend and add your provider's SMTP credentials on a paid plan (from $5/month), so mail goes out through your provider while spam filtering and storage stay handled.

Is my visitors' data exposed if there's no server?

No. The browser sends the submission over HTTPS straight to the form backend, which stores it in your account behind a login. The access key in your HTML only tells splitforms which form a submission belongs to; it can't be used to read your submissions.

Next steps

Related articles

More practical guidance from tutorials.

Browse the journal →
Tutorials

How to Remove the Arrows From a Number Input (CSS, Tailwind, React)

Hide the number input spin buttons with ::-webkit-inner-spin-button and appearance: textfiel…

7 min readRead →
Tutorials

How to Change the Autofill Background Color of an Input (CSS, Tailwind)

Remove Chrome's yellow autofill background with input:-webkit-autofill, inset box-shadow, -w…

7 min readRead →
Tutorials

input type=number maxlength Not Working? 4 Fixes That Work

Why maxlength is ignored on input type=number, plus four fixes: min/max, oninput slice, text…

8 min readRead →

Explore this topic

Start with the overview, then move into focused guides.

OverviewContact Forms for Every FrameworkStart here →GuideContact Form for Next.jsRead →GuideContact Form for ReactRead →GuideContact Form for VueRead →ReferenceContact form guideOpen →

Building forms with ChatGPT, Claude, Cursor, or v0? Connect the native MCP server and give your agent a production form backend.

Explore the MCP server →

Give your form a production backend.

One endpoint adds delivery, spam filtering, storage, and integrations. Start with 500 free submissions — no card, no time limit.

Create free accountRead the docs →
Secure checkoutSSL encryptionPrivacyProtected
VISAAMERICANEXPRESSstripe