All posts
htmlemailno-backend

How to send email from an HTML form without PHP

2 min readBy wwwform

The short answer

An HTML form can't send email on its own — sending mail needs a server, and PHP was the old way to provide one. Instead of installing PHP, paste the wwwform embed snippet into your page and every submission is emailed to you and saved to your dashboard, no server required.


title: How to send email from an HTML form without PHP description: The classic problem — you have an HTML form but no PHP or server to send the email. Here's why it can't work alone, and the one-line fix that delivers every submission to your inbox. date: 2026-06-20 author: wwwform tags: [html, email, no-backend] hero: broken-form tldr: An HTML form can't send email on its own — sending mail needs a server, and PHP was the old way to provide one. Instead of installing PHP, paste the wwwform embed snippet into your page and every submission is emailed to you and saved to your dashboard, no server required. faq:

  • q: Can an HTML form send email without any backend at all? a: Not by itself. The browser can collect what someone types, but actually delivering an email requires a server with an email provider and secret credentials. wwwform is that server — you paste one line and it handles delivery for you.
  • q: Why is PHP the answer everyone gives? a: For years the simplest server most hosts shipped was PHP, so the standard tutorial used a mail() script. If your host has no PHP — like GitHub Pages, Netlify or any static site — that approach can't run at all. A hosted form handler works everywhere.
  • q: Isn't there a way to email straight from JavaScript? a: Tools that claim to send SMTP from the browser expose your email password in page code and are routinely blocked or abused. The safe pattern is to POST to a backend that sends the mail. wwwform gives you that backend without writing any code.

You have a plain HTML page with a contact form. You want a message to land in your inbox when someone fills it in. Every tutorial you find says to write a PHP script — but you don't have PHP, don't want to learn it, or your host (GitHub Pages, Netlify, Neocities, an S3 bucket) doesn't run server code at all.

This is one of the oldest questions on the web, and the short answer is: an HTML form cannot send email on its own. Here's why, and what to do instead.

Why the form alone does nothing

A form is just markup. When someone hits Send, the browser bundles up the fields and tries to deliver them somewhere — but a static page has nowhere to deliver them to. Actually sending an email needs three things that can't live in a browser:

  • A server that receives the submission.
  • An email provider (SMTP or an API) that puts the message in a real inbox.
  • Secret credentials for that provider — which must never be exposed in page code.

PHP was simply the historical answer: most cheap hosts shipped it, so the standard recipe was a small mail() script on the server. If your host has no PHP, that recipe can't run — and modern static hosting almost never includes it.

Why not mailto:?

The other classic suggestion is <form action="mailto:you@example.com">. Avoid it. It opens the visitor's own email client instead of sending anything, breaks entirely for anyone using webmail, loses the data if they don't have a mail app configured, and exposes your address to scrapers. It is not a real form handler.

The one-line fix

Instead of standing up PHP, point the form at a backend that already exists. Build your form once in wwwform, then paste a single snippet into your HTML page:

<div id="wwwform-k_yourkey"></div>
<script src="https://cdn.wwwform.com/f/embed.js" data-wwwform="k_yourkey" async></script>

That's the whole integration. The form appears where you drop the snippet, every submission is saved to your dashboard, and you get an email the moment someone fills it in — no PHP, no SMTP setup, no server to maintain.

It runs on any host

Because the snippet is just HTML and a script tag, it works on a static host that could never run PHP — GitHub Pages, Netlify, Vercel, Neocities, S3, or a file you open locally. The same line that fixes a hand-written page also fixes a page an AI tool generated for you.

One line, and the form you already have finally delivers.

Frequently asked

Can an HTML form send email without any backend at all?

Not by itself. The browser can collect what someone types, but actually delivering an email requires a server with an email provider and secret credentials. wwwform is that server — you paste one line and it handles delivery for you.

Why is PHP the answer everyone gives?

For years the simplest server most hosts shipped was PHP, so the standard tutorial used a mail() script. If your host has no PHP — like GitHub Pages, Netlify or any static site — that approach can't run at all. A hosted form handler works everywhere.

Isn't there a way to email straight from JavaScript?

Tools that claim to send SMTP from the browser expose your email password in page code and are routinely blocked or abused. The safe pattern is to POST to a backend that sends the mail. wwwform gives you that backend without writing any code.

Make your form actually work

Build a form, paste one line, and start collecting submissions. Free for your first 100 a month — no credit card.