← Back to Blog
Guide

HTML Form Send to Email — Without PHP or Any Backend Code

March 22, 2026 · 10 min read

If you've ever searched for "how to make an HTML form send to email," you've probably found two answers: use mailto: (which doesn't actually work as expected) or write a PHP script (which requires a server).

Both are bad options in 2026. The mailto: approach just opens the user's email client — it doesn't submit form data. And PHP requires hosting that can run server-side code, which rules out static hosts like Netlify, Vercel, GitHub Pages, and Cloudflare Pages.

The modern solution is a form-to-email API — a service that gives you an endpoint URL. You point your form's action attribute at it, and the service handles the rest: processing the data, formatting it, and sending it to your email.

The Old Way: Why mailto: Doesn't Work

You might have seen this approach floating around:

❌ The broken approach
<!-- DON'T DO THIS — it doesn't work reliably -->
<form action="mailto:you@example.com" method="POST"
      enctype="text/plain">
  ...
</form>

This doesn't actually submit the form data to an email. It opens the user's default email client (Outlook, Apple Mail, etc.) with a pre-filled email. If they don't have an email client configured — which is most people in 2026 — nothing happens at all. And on mobile, the behavior is unpredictable.

The Modern Way: Form-to-Email API

Here's how a form-to-email service like formto.email works. You create an endpoint, then use it as your form's action:

✅ The modern approach — works everywhere
<form action="https://formto.email/f/your-form-id" method="POST">

  <input type="text" name="name" placeholder="Your name" required />
  <input type="email" name="email" placeholder="Your email" required />
  <textarea name="message" placeholder="Your message" required></textarea>

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

When a visitor submits this form, their browser sends a POST request to formto.email. The service processes it, runs it through spam filters, and delivers a clean, formatted email to your inbox. The visitor gets redirected to a confirmation page (or a custom URL you set).

Submitting with JavaScript (AJAX/Fetch)

If you want to submit the form without a page reload — for example, to show a success message inline — you can use the Fetch API:

JavaScript fetch submission
const form = document.querySelector('form');

form.addEventListener('submit', async (e) => {
  e.preventDefault();

  const response = await fetch('https://formto.email/f/your-form-id', {
    method: 'POST',
    body: new FormData(form),
    headers: { 'Accept': 'application/json' }
  });

  if (response.ok) {
    form.innerHTML = '<p>Thanks! Your message has been sent.</p>';
  }
});

By setting the Accept header to application/json, formto.email returns a JSON response instead of redirecting — perfect for single-page apps and AJAX submissions.

Adding File Uploads

Need to accept file attachments? Just add a file input. formto.email handles multipart form data automatically:

File upload support
<form action="https://formto.email/f/your-form-id"
      method="POST"
      enctype="multipart/form-data">

  <!-- ...other fields... -->

  <input type="file" name="attachment" />
  <button type="submit">Send</button>
</form>

File uploads require a Pro plan ($7/month) and support files up to 25MB per submission. The files are stored securely and included as attachments in your notification email.

Sending to Multiple Email Addresses

You can configure multiple recipients in your formto.email dashboard. But you can also specify recipients directly in your form using a hidden field:

Multiple recipients
<input type="hidden" name="_cc" value="team@example.com,boss@example.com" />

Static Site Hosting + formto.email = Perfect Pair

If your site is hosted on any of these platforms, formto.email is the easiest way to add working forms:

Make your HTML form send to email in 60 seconds

No PHP. No backend. No server. Just paste a URL and you're done.

Create Free Account →

Summary

In 2026, you don't need PHP, Node.js, or any server-side code to make an HTML form send to email. A form-to-email API like formto.email handles everything — processing, spam filtering, email delivery, and file uploads — so you can focus on building your website, not debugging mail servers.