# How to send HTML form to email without PHP

> Send HTML form to email without PHP or any server code. Point your form at a form backend, add a key, and get every submission in your inbox.

Guide

Send HTML form to email without PHP or any server code. Point your form at a form backend, add a key, and get every submission in your inbox.

By [Venkatesh](https://www.linkedin.com/in/ageven/) 2 November 2026 · 5 min read

![Cover image: How to send HTML form to email without PHP, a FormDoc guide](https://www.formdoc.dev/images/blog/html-form-to-email-without-php.png)

The short answer: you can send HTML form to email without PHP by pointing the form’s `action` at a form backend. The backend receives the post, checks it for spam and emails it to you. You write plain HTML, add one hidden field with your access key, and never touch a server. This guide shows the full form, explains each part and lists the things to check before you go live.

## Why HTML alone can’t send email

A browser can’t send email by itself. When someone presses “Send”, the browser packs up the field values and posts them to whatever URL is in the form’s `action`. Something at that URL has to read the data and hand it to a mail server.

For years that “something” was a PHP script on the same host as the website. That works if your host runs PHP and you’re happy to maintain the script, deal with mail headers and keep spam out. Many sites today don’t have that option at all: static hosting, site builders and AI-built sites serve files only. There is no backend to run code.

That’s the gap a form backend fills. It is the server you don’t have to write.

## The form to email without server code

Here is a complete contact form that sends to your inbox. Copy it, replace the key, and it works on any page:

```html
<form action="https://api.formdoc.dev/v1/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New message from my website">

  <label for="name">Name</label>
  <input id="name" type="text" name="name" required>

  <label for="email">Email</label>
  <input id="email" type="email" name="email" required>

  <label for="message">Message</label>
  <textarea id="message" name="message" required></textarea>

  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">

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

That’s all the code there is. No PHP file, no Node function, no SMTP password in your repository.

## What each part does

1.  **`action` and `method="POST"`** send the data to FormDoc’s endpoint instead of your own server.
2.  **`access_key`** tells FormDoc which form this is and who should get the email. It’s public and safe to leave in your HTML: it only lets people send you submissions, nothing more.
3.  **`subject`** sets the subject line of the notification email, so you can filter these messages in your inbox.
4.  **`name` attributes** on every input become the labels in the email. A field without a `name` is never sent, so give each one a clear name.
5.  **`botcheck`** is a hidden honeypot. People never see it, simple bots fill it in, and those posts are stored as spam with no email. The [spam guide](https://www.formdoc.dev/blog/stop-form-spam/) explains the other layers.
6.  **`type="email"` and `required`** let the browser catch empty or badly typed fields before the form is sent.

## Get your access key

You don’t need an account to start:

1.  Go to [https://app.formdoc.dev/new](https://app.formdoc.dev/new) and enter the email address that should receive submissions.
2.  Open the confirmation email and click the link.
3.  Copy your access key and paste it into the `value` of the hidden `access_key` field.

Because the key only arrives after you confirm, submissions always go to an inbox that agreed to receive them.

## PHP mail script vs no backend

If you’re choosing between writing a script and using a form backend, these are the practical differences:

|  | PHP mail script | Form backend (no backend for you) |
| --- | --- | --- |
| Hosting needed | A host that runs PHP | Any host, including static files |
| Code to maintain | Script, headers, validation | One HTML form |
| Spam protection | You build it | Honeypot, spam scoring, rate limits, optional captcha |
| Email delivery | Depends on your host’s mail setup | Handled for you |
| Reply to the visitor | You set headers yourself | Reply-To is set to the visitor’s email |
| Works on site builders | Usually not | Yes |

A PHP script still makes sense if you need custom logic on your own server. For a contact form, a quote request or a sign-up, it’s a lot of moving parts for a simple job.

## What happens after someone presses Send

When the form is posted, FormDoc checks the key, applies rate limits and spam checks, stores the submission (encrypted) and emails it to you. Because the Reply-To header is set to the email the visitor typed, you can answer by pressing Reply in your mail app.

The visitor then sees a hosted thank-you page with a link back to your site. If you’d rather send them to your own page, add a `redirect` field with a full URL:

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

If you want the form to show a success message without leaving the page at all, add the optional script before `</body>`:

```html
<script src="https://api.formdoc.dev/formdoc.js" defer></script>
```

It sends the form in the background, disables the button while sending and shows the result inside the form. Without JavaScript the form still works the normal way.

## Checks before you go live

-   Send a real test message from the live page, not just from your laptop.
-   Look in your spam folder the first time, and mark the message as “not spam” if needed.
-   Confirm every input has a `name` and the right `type`.
-   Keep the honeypot field in place, even if you also add a captcha later.
-   Make sure the key in the HTML matches the one in your confirmation email.

If the form posts but no email arrives, the [troubleshooting guide for forms that don’t send](https://www.formdoc.dev/blog/ai-built-form-not-sending/) walks through the usual causes.

## Common questions

### Is it safe to put the access key in my HTML?

Yes. The access key only identifies the form and lets people send submissions to it. It gives no access to read your submissions or change settings, so it’s fine in public page source.

### Does this work on static hosting and site builders?

Yes. Because the form is plain HTML posting to an external URL, it works on any host that serves pages, including static site generators, React or Vue apps, and builders that let you add custom HTML. The [static site contact form guide](https://www.formdoc.dev/blog/contact-form-static-site/) covers this in more detail.

### How many submissions can I receive for free?

The Free plan includes 250 submissions a month, unlimited forms and email notifications. You get an email at 80% and 100% of the limit, and 10% extra is accepted before new submissions pause until the next month.

## Next step

If you want a ready-made starting point, the [contact form template](https://www.formdoc.dev/templates/contact/) has the fields, labels and honeypot already in place. Paste in your key and your HTML form will send to email without PHP or any server of your own.

For every option FormDoc supports, from redirects to JSON responses, see the [quick start](https://www.formdoc.dev/docs/) and the [API reference](https://www.formdoc.dev/docs/api-reference/). The Free plan covers 250 submissions a month; [pricing](https://www.formdoc.dev/pricing/) has the details.

Written by**[Venkatesh](https://www.linkedin.com/in/ageven/)**
